Reply to topic

Using the moveByBearing function

cmaranto
Registered Member
Posts
2
Karma
0

Using the moveByBearing function

Tue Nov 03, 2015 10:16 pm
Hi,

I have an application where I need to draw a bearing line from one location to another. I need to calculate the destination position given the start position, the bearing, and the distance in meters. I found the GeoDataCoordinates::moveByBearing function which specifies the distance as "distance on a unit sphere". What is the formula to convert a distance in meters to a distance on the unit sphere?

Thanks
User avatar tackat
KDE Developer
Posts
121
Karma
0
OS
A unit sphere is a sphere which has the (unitless) radius 1.
The circumference of a big circle in such a unit sphere is 2 * M_PI
For a given distance d_k in kilometers and an earth radius of
about 6378 km you can calculate the distance on a unit sphere
d_u using the rule of three:

d_u = d_k * M_PI / 20037

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Dibo, Google [Bot], hsnnsnc, Majestic-12 [Bot], medmedin, nocruoro, shroobster, Snudl, tymond