Hi, I’m making an app for taking a GPX (a list of GPS) coordinates and converting it to a vector that can be read by apple motion, so that I can animate and design my own path.

The altitude is done, and now the path on where is next up.

The vector is done, but I can not figure out how to scale it properly. My map, that has a lat of 46.43, but how to scale this, I now it is suppose to be around 1.5, but how to get to it and how to calculate it…

I read a lot about a Mercator_projection, but how to get this into xojo?

I have the lat and lon, in degrees, so I have the max and min of both lon and lat.

In my head I should be able to get a ratio of the map in a one to one by these numbers. But then I have to scale it even further based on where on the earth I am. So according to wikipedia :

at latitude 30° the scale factor is *k* = sec 30° = 1.15,

at latitude 45° the scale factor is *k* = sec 45° = 1.41,

at latitude 60° the scale factor is *k* = sec 60° = 2,

at latitude 80° the scale factor is *k* = sec 80° = 5.76,

at latitude 85° the scale factor is *k* = sec 85° = 11.5

but how can I make a formula to get these values…

any thoughts?