Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 01-10-2012, 07:18   #1
Registered User
 
Gilletarom's Avatar

Join Date: Mar 2010
Location: France
Boat: 10.50 mètres
Posts: 3,022
Distance between 2 points ?

Hello Dave, hello JesperWe, Hello Pavel, Hello all,

Who can tell me how OpenCPN 3.0.2 calculates the distance between two points. for example
- The starting point 30 South 150 West
- Arrival 45 South 100 West,

Mathematical answer and accepted line of code in question.

Thank you in advance.

Gilletarom.
Gilletarom is offline   Reply With Quote
Old 01-10-2012, 07:39   #2
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Distance between 2 points ?

Most of the time it is calculated using ordinary trigonometry in Spherical Mercator coordinates.

The code is in DistanceBearingMercator() in the src/georef.cpp file.

The calculations will not be accurate over very long distances like in your example.

You can use the Route tool in the betas to see the difference between the SM (rhumbline) distance and the true Great Circle distance.
JesperWe is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 14:42.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.