Cruisers Forum

Join CruisersForum Today

Thread Tools 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: 2,521
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 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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 22:45.

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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.