Conversion between two coordinates systems

Moderators: Uros, OXO, JBr

Post Reply
User avatar
DAVC
Posts: 18
Joined: Mon May 07, 2018 12:02 pm

Conversion between two coordinates systems

Post by DAVC » Wed Apr 15, 2020 12:38 pm

Hi All,
I'm trying to write a program that can take an airspace file and produce a load of penalty zones to try and approximate it.
Does anybody know of a mathematical way to convert between LAT LONG and PosX PosY?
Image
Cheers,
David
K13! K13! K13!

User avatar
Bre901
Posts: 1799
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Conversion between two coordinates systems

Post by Bre901 » Wed Apr 15, 2020 12:53 pm

I was about to tell you to do a search, but my tool doesn't show up in the search (although I'm convinced I mentioned it somewhere)

Take a look there : https://condorutill.fr/index.php#CoCoCo
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
DAVC
Posts: 18
Joined: Mon May 07, 2018 12:02 pm

Re: Conversion between two coordinates systems

Post by DAVC » Wed Apr 15, 2020 1:24 pm

Thanks for that, would you mind sharing the maths behind it as I'm not quite sure how I'd go about integrating your program into my code.
K13! K13! K13!

User avatar
Bre901
Posts: 1799
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Conversion between two coordinates systems

Post by Bre901 » Wed Apr 15, 2020 2:11 pm

https://en.wikipedia.org/wiki/Universal ... ate_system
French version with easier to use formulas : https://fr.wikipedia.org/wiki/Transvers ... e_Mercator

You could also use the Navicon.dll which is available in Condor and converts XY to lat and lon and then solve the inverse equations (as far as I can remember, Newton-Raphson is a bit tricky to program as you need to make numerical derivatives and 32 bit floating points are close to bit rounding errors, but dichotomy works fine)

Or I could give you a DLL, callable from C, that does the above UTM conversions (both ways), these routines are used in my different tools.
However that would not be before tomorrow (and no warranty whatsoever, of course)
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
DAVC
Posts: 18
Joined: Mon May 07, 2018 12:02 pm

Re: Conversion between two coordinates systems

Post by DAVC » Wed Apr 15, 2020 2:24 pm

Thats brilliant thank you! :D
K13! K13! K13!

Post Reply