Ok, so after slogging through the math, and going to a local college to get my head straight, and to get some help, here finally I can see some light at the end of the road. So now I have to lay out the software, for you, and myself. So I drew a little planet with a VOR station and the Sonic Cruiser.
So on the left, you see a diagram of our little problem, we have a VOR Station (which we know where it is (Lat, Lon, H), from an FAA Navaids DB that I have. This DB is mySQL accessed via JASON API. We also have a Sonic Cruiser, and we know where it is (Lat, Lon, Alt) from the simulator. Given the six pieces of information that we have, we can now generate the distance between both objects on the ground by the use of the Great Circle Navigation Software. Now we need to find the distance between the VOR Station and the center of the earth. This is done EarthCenterCalculator software. Next, we have to use the Station's H (height above sea level). Next, I can use the Pythagorean theorem, to generate the slant range. where
Distance ::= Antenna height above sea level
Altitude ::= Aircraft Altitude above sea leve
So HEY C DOSE NOT HAVE A NOTATION or FUNCTION for A xe2
you could use a = a x a
but why don't you use a #define Sq (x) ((x)*(x))
so here's what you should do: Create program_name.h file and insert one line of code the #define
tells the C pre-processor that you have just created the function #define
So now we have the Sq() but now we have to tell the Compiler to use it
you now have to put one line of code in your program,
#include program_name.h
ok now on with the code.
TOP OF THE PAGE
#include program_name.h
float main(argv, argc){
// remember to specify the type of the Variables
return( Square Root( Sq(Distance) + Sq(Altitude))); //- but then you have to convert to miles. Now My program(S) have a several .h files I use them for organization. REMEMBER YOU MUST WATCH YOUR CAPs AS C in not c FIns