Sign in to follow this  
Guest eko

Spherical Geometry

Recommended Posts

I am working on a radar gauge, and I need the spherical geometry to compute:- the distance between my aircraft and another aircraft (both aircraft positions given in latitude/longitude)- the bearing (relative heading) of my aircraft relative to another aircraftThanks for any help !!Eric

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Do you need the full spherical geometry or is a "quasi"-flat geometry sufficient? Since radar distances aren't that great a flat geometry could be precise enough.Arne Bartels

Share this post


Link to post
Share on other sites

double pi=3.1415926535897932384626433832795;double LLdistance(double lat1, double lon1, double lat2, double lon2){ double distance; lat1=lat1*(pi/180); lon1=lon1*(pi/180); lat2=lat2*(pi/180); lon2=lon2*(pi/180); distance = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))*((180*60)/pi); return distance;};double LLcourse(double lat1, double lon1, double lat2, double lon2){ double course; lat1=lat1*(pi/180); lon1=lon1*(pi/180); lat2=lat2*(pi/180); lon2=lon2*(pi/180); course = fmod(atan2(sin(lon1-lon2)*cos(lat2),cos(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon1-lon2)), 2*pi); return course;};Chris Filehttp://www.avsim.com/pss/phoenix.jpg

Share this post


Link to post
Share on other sites

Thanks for your help !!Your formulas helped me much. My radar gauge is almost finished, it works pretty fine now.Eric

Share this post


Link to post
Share on other sites

A little more patience, I'll release it soon. To make you wait, here are some screenshots. They show the 3 radar modes: global, horizontal and vertical.Eric

Share this post


Link to post
Share on other sites

Chris, Thank you.... Been looking all over for this info.Roman(KGRB)

Share this post


Link to post
Share on other sites

Just to let you know tables are much faster (cept I dont know how to use them !) and wondering if fsim uses tables in trig calculations?mr gray

Share this post


Link to post
Share on other sites

My radar and HUD gauges have finally been released. I included them on Johan Peeters' F-16 panel.Due to problems with Rick Rossner, AVSIM will never see again a single piece of my work. You can get the panel on the other site. Search the file f16pnlem.zip.Enjoy !!!Eric

Share this post


Link to post
Share on other sites

Oh yeah, I really must admit, this is great. You did a good piece of work. It doesn't just work, it also looks good (animations etc.)! :-) How the hell did you get the different mouse hot spots moving around... Incredible.Just keep up the great work, would like to see other gauges of this quality! :-hahRegards :-wave from EDDFhttp://flightsimmers.net/airport/etti/signature_pro.jpgPS. Hmmm since FlightSim.Com is down again (as always... :-erks) and since I don't get any acceptable result out of the AVSIM File Library, I don't have a F-16 a/c yet... Tried the panel only with the Learjet.

Share this post


Link to post
Share on other sites

Thanks for your compliments !!You can get the excellent F-16 by G.Chiacchietta on FS Freeware.One link is: FRF_F-16_C.zipHave fun !!

Share this post


Link to post
Share on other sites

Hey I just woke up, got to the PC, fired up FS and tried it once more, with 100% ATC, and it's just cool!!! Escorted a Dash 8 in my, errr... still - Learjet. But thank you for the link, I gotta download that F-16 now. But tell me one thing: Well I've seen it on other fighter panels, but what's that indication?http://flightsimmers.net/airport/etti/avsi...hers/escort.jpg> Have fun !!I DO!!!Thanks again! :-hahRegards :-wave from EDDFhttp://flightsimmers.net/airport/etti/signature_pro.jpg

Share this post


Link to post
Share on other sites

This indicates if you're flying straight, climbing or descending. It is redudant with the 2 little arrows that appear on the HUD above or below the altitude numerical display.It is a sort of vertical speed display which only indicates if it is positive, negative or null.Eric

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this