Skip to content

Instantly share code, notes, and snippets.

Avatar

Skybuck Flying SkybuckFlying

  • e-mail: skybuck2000@hotmail.com
View GitHub Profile
@SkybuckFlying
SkybuckFlying / XYZ_2_latlong.py
Created Aug 6, 2022 — forked from mpkuse/XYZ_2_latlong.py
Convert GPS (Latitude and Longitude) to XYZ
View XYZ_2_latlong.py
""" Give a) points in localcoordinate system b) a gps lat long of the origin of the local coordinate system,
this script helps to convert XYZ to latlong.
Beware that the transformation will be off by an yaw angle. This is because the local cordinate frame is may/or may not align with the East-North-Up frame.
The way it works is XYZ --> ECEF --> geodedic (latlong)
main reference is still the wiki https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_ECEF_to_ENU.
However the procedure to convert from ECEF to geodedic in wikip does not give accurate results. Instead the algorithm