Description Usage Arguments Value Author(s) References Examples
Giver the angle from a origin to a certain destination.
1 | ang_head(Ta, La, Tb, Lb)
|
Ta |
Latitude of the origin point. |
La |
Longitude of the origin point. |
Tb |
Latitude of the destination point. |
Lb |
Longitude of the destination point. |
b |
The angle direction. |
Natan Freitas Leite.
http://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## The function is currently defined as
function (Ta, La, Tb, Lb)
{
Ta = rad(Ta)
Tb = rad(Tb)
La = rad(La)
Lb = rad(Lb)
dL = abs(Lb - La)
x = cos(Tb) * sin(dL)
y = cos(Ta) * sin(Tb) - sin(Ta) * cos(Tb) * cos(dL)
b = atan2(x, y)
b = deg(b)
return(b)
}
##Kansas City: 39.099912, -94.581213 -> St Louis: 38.627089, -90.200203
##Result should be: ang.head=96.5126242349993
a=ang_head(39.099912, -94.581213,38.627089, -90.200203)
a
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.