Ok, this is how I'm going to solve this mess. first, we know two things :

- We know where the aircraft is in three dimensions: Lat, Lon, and Alt (above sea level)
- We know where the Station is in three dimensions: Lat, Lon, and Antenna (above sea level)

Now that we know both locations on the Earth, we can then use *Great Circle *math to determine the distance between both objects: * d = acos(cos(lat1 - lat2) - (1 - cos(lon1 - lon2)) * cos(lat1) * cos(lat2)); *if d is the distance between the objects on the line of

**H**greater than 200 miles do the following: Set the FLAG to OFF; otherwise we need the height above sea level for the antenna and the aircraft, the aircraft is data is available from the simulator itself, while the antenna information is from FAA Navaids Database so let's pick Fort Worth NAS JRB TACAN (108700: 32.7714996337891: -97.4394989013672: 663; in order Freq (Khz, Lat, Lon, elevation in feet. So we know the height of the antenna which is 663 feet. We know from our simulator that the aircraft is at 15,000 feet above sea level so we have to subtract the 663 from the 15, 000 to arrive at 14,337 feet adjusted. So now we can generate R or the Slant Range by solving for the hypotenuse of a right triangle: square root ( H

^{2}+Alt

^{2}) or in C as

*Set the FLAG to ON and Set TO-FROM to TO and Send the Distance to the DME readout, and start sending the station ID via Morse Code to the pilot on the audio channel. Now you must remember that this only works if the pilot flying the aircraft has tuned to the correct station. In real life, you should not have picked this station as you will have to fly into a NOFLY ZONE. Oh if you were keeping up the Slant Range works out to 200 nm.*

**slant Range = sqrt(SQ(H)+SQ(Alt));**I guess there will have to be some as I have not solved this equation yet:* R^{2}=r_{e}^{2}+(r_{e}+H)^{2}-2r_{e}(r_{e}+H) cos α *which will yield the correct slant range.

Addendum: April 26, 2023 I just happened to find the equation at any Latitude at Sumit.org:

D= f(Φ,Z,G)** = (√[(**(a^{4} cos^{2} Φ + b^{4} sin^{2} Φ a^{2})/(cos^{2} Φ + b^{2} sin^{2} Φ)) + 2 (Z+G)**√**( a^{2} cos^{2} Φ + b^{2} sin^{2} Φ) + (Z+G)^{2} ]

* D* is the distance to the Center of the Earth

*is the latitude (the angle measured north or south from the equator)*

**Φ***is the height above sea level (i.e., the elevation of the point on the Earth, such as a summit)*

**Z***is the geoid height above or below the ellipsoid (the user must also know the longitude of the point in question)*

**G***is the semimajor axis (the equatorial diameter of the Earth)*

**a***is the semiminor axis (the pole-to-pole diameter)*

**b**The units must be consistent across the equation. If

*is in meters,*

**Z***,*

**a***, and*

**b***must be in meters. If*

**G***is in feet,*

**Z***,*

**a***, and*

**b***must be in feet.*

**G**The WGS 84 ellipsoid defines

*and*

**a***as:*

**b***= 6,378,137.000 meters = 20,925,646.3255 ft*

**a***= 6,356,752.314 meters = 20,855,486.5945 ft*

**b**