Registered Member
|
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 |
KDE Developer
|
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 |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], mesutakcan, Sogou [Bot]