element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
NexGen Flight Simuator Flight Simulator 101 or back to college - part 2: Navigation
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 23 Dec 2012 9:37 PM Date Created
  • Views 399 views
  • Likes 2 likes
  • Comments 2 comments
  • c
  • perl
  • flight_simulation
  • webpage
  • diy_cockpit
  • feature_tutorial
  • linux
Related
Recommended

Flight Simulator 101 or back to college - part 2: Navigation

phoenixcomm
phoenixcomm
23 Dec 2012

Have you ever wondered how you navigate on a round world? Remember Columbus thought was flat. So if the world was flat you could stick two pins in the map, and follow the angle from North. But as we know today the world is round so, sadly that will not work…image

So we came up with Great Circle Navigation.  Apparently, the first reference to great circle navigation was by imageJohn Davis in his book, The Seaman’s Secrets (1594).  The theory was understood, but in practice it could hardly be applied without accurate computation of longitude.

With Harrison’s Chronometer (1736), this was then possible.   image

The theoretical proof was given by Bernhard Riemann around 1900.   

 

 

 

 

 

 

 

 

 

 

 

Here is the math that you have to use:

 

Distance = acos(cos(Lat1-Lat2) – (1-cos(Lon1-Lon2)) * cos(Lat1)*cos(Lat2))

 

Here is some code:

/*

L1 = Original Lat; L2 = Destination Lat;

Lon1 = Original Lon; Lon2 = Destination Lon

D = Distance in Nautical Miles

*/

Lon1 = -Lon1;

Lon2 = -Lon2;

if(( L1 == L2 ) && ( Lon1 == Lon2 )){

     return(0);}

temp = ( cos( L1 ) * cos( L2 ) * cos( Lon1 – Lon2 ))+( sin( L1 ) * sin( L2 ));

if( temp == 1 ){

     temp = 0;}

elsif ( temp == -1 ){

     temp = pi/2;}

else {

     temp = 0 – atan( temp / sqrt( 1 – ( temp * temp ))) + pi / 2;}

     temp = (( sin( L2 ) – sin( L1 ) * cos( temp )) / (sin( temp ) * cos( L1 )))

if( 1 – temp < .00000001 ){

     return( 360 );}

elsif ( 1 + temp < .000000001 ){

     return( 180 );}

else {

     temp = rad2d( -atan( temp / sqrt( 1 – ( temp * temp ))) + pi / 2;)

     if( sin( Lon2 – Lon1 ) > 0 ){

          temp = 360 – temp;}

return( temp );}

 

This code was written in Perl you can run this code on THIS PAGE

sorry for the Perl but it was easyer to test than a page of C hooked to 2 web pages image

 

image keep tuned in more to come

Cris ~

  • Sign in to reply
  • phoenixcomm
    phoenixcomm over 12 years ago in reply to DAB

    most likely

    thanks --

    image Keep tuned in ~

    BTW I posted the third in the series ... Eular angles

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 12 years ago

    Hi Chris,

     

    Another good post.  Are you going to continue this sequence with showing how accelerometers fit into an integrated navigations solution?

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube