General Question Add runway - how to convert lat/lon to Orbiter coordinates

mstram

Member
Joined
Oct 21, 2008
Messages
47
Reaction score
0
Points
6
Location
Toronto
When adding a runway(s) / creating a new base, how do you convert lat/lon to Orbiter coordinates ?

I have the Surface Base Wizard, and the lat / lon calculator does the opposite function (input the coordinates, get the lat/lon).

I could use that to 'grope & guess', .... and might do so, unless I can find a more elegant solution.

Has anybody already added the real world airports for Ontario .. all of Canada .. all of U.S. ? ....

thx


Mike
 
You need to calculate a distance between base center coordinates and object coordinates you want to place in the base, and bearing from base center to the object. For runways you will need to get the END1 and END2 coordinates, and not the coordinates of midpoint of runway.

If you have all longitudes and latitudes, you can calculate distances and bearings from formulas that are for example on this page:
http://www.movable-type.co.uk/scripts/latlong.html

And then, the local (in base) coordinates you can get from:
x = distance * cos (bearing)
z = distance * sin (bearing)​
Only I'm not sure, whether you need to change the sign of either "x" or "z", or exchange sine with cosine, because I didn't check the results of these formulas recently.

And if you need "y" coordinate (above the ground) for any reason (it's needed for example for runway lights, which aren't mapped to sphere at all):
y = (1 - cos (distance / earth_radius)) * earth_radius​

Note that "x", "y", and "z" are in meters, so you need to provide "distance" and "earth_radius" for the formulas in meters too. The calculated "y" is a value you need to subtract from "y" coordinate of END1/END2 objects (other than runways), which aren't mapped to sphere, to make their ends placed on the ground, and not float in air. For longer objects, it's better to subtract less than calculated "y" (but less by the same amount) for both ends, because otherwise the center of END1/END2 object will be underground.

---------- Post added at 02:54 ---------- Previous post was at 02:31 ----------

Has anybody already added the real world airports for Ontario .. all of Canada .. all of U.S. ? ....
I'm not sure for all of Canada, but you can check runways exported by Topper in this thread. There are runways for Europe, U.S. and worldwide.
 
Back
Top