Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XYZ ECEF positional variables

Featured Replies

Does anyone know if FS has any aircraft positional variables that are available in earth-centered/earth-fixed (ECEF) format? I know that XML has velocity variables in XYZ but I haven't seen any positional XYZ variables. XYZ variables are so much easier in doing vector/matrix mathematics.Thanks,Thomas Magma

Hello Thomas,which version 9 used a biconal projection but 10 will probably use an ellipsoidal model to get up to both poles.Ian

According to the appendix to the FS9 SDK "Creating Terrain and Land Classification" (May 2004):In Flight Simulator, the earth is defined as an

Gerry Howard

The ECEF coordinate system does not care what model is used for the shape of the earth. It is simply the XYZ coordinates relative to the earths center (usually in meters). I have the sneaking suspicion that FS uses XYZ coordinate system as a basis to determine position of an aircraft and then converts it to long, lat and alt. I want access to the raw XYZ variable to make my math easier and more efficient in my gauge application. I see XML has parameters called:XML_VELOCITY_WORLD_XXML_VELOCITY_WORLD_YXML_VELOCITY_WORLD_ZThis is great when working with velocity vectors, but I would also like to have something like:XML_POSITION_WORLD_XXML_POSITION_WORLD_YXML_POSITION_WORLD_ZTo have this would make it easy to work with vector mathematics.I see that GAUGES.H have a typedef struct that looks like this:typedef struct XYZF64{ union { struct { FLOAT64 lon; FLOAT64 alt; FLOAT64 lat; }; struct { FLOAT64 x; FLOAT64 y; FLOAT64 z; }; struct { FLOAT64 pitch; FLOAT64 heading; FLOAT64 bank;}; };}XYZF64, *PXYZF64, **PPXYZF64,POS3_FLOAT64,VEL3_FLOAT64, *PVEL3_FLOAT64, **PPVEL3_FLOAT64,ACC3_FLOAT64,ROT3_FLOAT64,ROV3_FLOAT64,ROA3_FLOAT64;But I'm not really sure what this means or if/how I can gain access to the XYZ variables. Any thoughts anyone?ThanksThomas Magma

  • Moderator

Unless you are coding a C gauge, the gauges.h file is useless for your needs. XML gauges have no access to anything in gauges.h directly or indirectly.Aircraft positions are reported by FS as lat, lon, and alt... period.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Yes, I am coding in C. I'm importing the XML parameters into my C code. Are you hinting it is in fact possible to acquirer XYZ parameters in C? What about this 'typedef struct XYZF64' union that is in gauges.h? Does this imply that these x y & z variables are somehow accessible to me?typedef struct XYZF64{ union { struct { FLOAT64 lon; FLOAT64 alt; FLOAT64lat; }; struct { FLOAT64 x; FLOAT64 y; FLOAT64 z; }; struct { FLOAT64 pitch; FLOAT64 heading; FLOAT64bank;}; };}XYZF64, *PXYZF64, **PPXYZF64,POS3_FLOAT64,VEL3_FLOAT64, *PVEL3_FLOAT64, **PPVEL3_FLOAT64,ACC3_FLOAT64,ROT3_FLOAT64,ROV3_FLOAT64,ROA3_FLOAT64;Thanks,Thomas Magma

  • Moderator

No. The X, Y, Z used in the struc are in fact the same velecocity vector variables directly accessible the 'regular way.' They are not static coordinates of the objects absolute spatial position.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks I can see that now ... POS3, VEL3 & ROT3 = position, velocity and rotation. But what about this other typedef that is actually commented as calling it a point vector.// XYZF32 - XYZW point(vector) in floating pointtypedef struct XYZF32 { FLOAT32 x; FLOAT32 y; FLOAT32 z; FLOAT32 w;} XYZF32, *PXYZF32;#ifdef __cplusplusstruct CXYZF32:public XYZF32{ CXYZF32() { } CXYZF32(FLOAT32 _x, FLOAT32 _y, FLOAT32 _z, FLOAT32 _w=1.0f) {x = _x; y = _y; z = _z; w = _w;}};#endifMagma

  • 2 weeks later...

(In conclusion to this thread.)I could not find any access to the ECEF XYZ variables in MS flight Simulator and it doesn't look like they are available in FSX either. This really surprised me since this is probably the foundation in which FS bases its coordinate system on. I ended up having the convert back from Lat, Long, Alt (LLA) to ECEF in a subroutine. I guess it is working OK, but at a cost processing power. I am going to send a request to the FS design team to allow access to ECEF variables from the runtime environment.Cheers,Thomas Magma

Out of interest, what are you using the ECEF variables for? Also, how do you get the Ellipsoid Height in addition to latitude and longitude?

Gerry Howard

The ellipsoid height is based off a reference ellipsoid, and the definition of the reference ellipsoid (oblate spheroid) that FS uses is published in the doc Creating Terrain and Land Classification. However, I'm pretty sure that the dimension for polar diameter written in that doc is a type-o and I just ended up using WGS84 definitions for the reference ellipsoid. It turns out that the ECEF coordinate system is much easier to do vector mathematics with than LLA coordinates. I use this math to determine relative velocities and approach angles between objects traveling on the ground and in the air.Thomas Magma

But, the Ellipsoid Height is the height above the ellipsoid - roughly equivalent to height. How do you obtain this from Flight Simulator? To get the three ECEF coordinates surely you need three input coordinates to define the aircraft's position - lat, lon and height?

Gerry Howard

I use the variable PLANE_ALTITUDE. Which is the "height" above the reference ellipsoid in meters. I'm pretty sure that the reference ellipsoid is equivalent to sea level in FS because I don't think that they would have modeled in gravitational distortions or the pull of the moon (tidal forces).Thomas Magma

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.