destination: Vincenty Direct Calculation of a Destination

Description Usage Arguments Details Value Author(s) Source References Examples

View source: R/destination.R

Description

destination estimates the destination latitude and longitude given a starting latitude and longitude, a bearing and distance.

For general information on Vincenty's formula, see e.g., http://en.wikipedia.org/wiki/Vincenty's_formulae. It states:
Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of an spheroid, developed by Thaddeus Vincenty in 1975. They are based on the assumption that the figure of the Earth is an oblate spheroid, and hence are more accurate than methods such as great-circle distance which assume a spherical Earth.

Note: this method assumes a locations are lat & lon given in WGS 84.

Usage

1
destination(lat, lon, bearing, distance)

Arguments

lat

a single value or vector of values representing latitude in decimal degrees from -90 to 90 degrees.

lon

a single value or vector of values representing longitude in decimal degrees from -180 to 180 degrees.

bearing

a single value or vector of values representing the bearings (directions) of interest ranging from 0 to 360 degrees.

distance

a single value or vector of values representing the distances in metres to the destination.

Details

Typical useages are:

  1. a single start location, bearing and distance to give a single output location
    –output would be a single destination location

  2. a single start location with one or more bearings or distances to give multiple output locations
    –output would be a destination locations for each combination of bearings and distances

  3. multiple start locations with a single bearing or distance
    –output would be a destination locations representing the bearing and distance from each of the start locations

  4. multiple start locations with multiple bearings or distances
    –output would be a destination locations representing the combinations of bearings and distances from each of the start locations
    – NOTE that the bearing and distance vectors must be of the same length of the input lat and long.

See examples for all possible usages.

Value

Returns a data.frame with:

lon1

the original longitude

lat1

the original latitude

bearing

the bearing used

distance

the distance used

lon2

the destination longitude

lat2

the destination latitude

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com

Source

The source code here was modified from http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html.

Destinations were validated against Geoscience Australia calculations (http://www.ga.gov.au/geodesy/datums/vincenty_direct.jsp).

References

Vincenty, T. 1975. Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of Nested Equations. Survey Review, vol XXII no 176. http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###single lat lons
lats = -85; lons = 165
#single bearing & single distance
destination(lats,lons,bearing=180,distance=500000)

#multiple bearings
destination(lats,lons,bearing=seq(0,360,length.out=9),distance=500000)

#multiple bearings
destination(lats,lons,bearing=45,distance=seq(0,5000000,length.out=11))

#multiple bearings, multiple distances
destination(lats,lons,bearing=seq(0,360,length.out=9),
    distance=seq(0,5000000,length.out=11))

###multiple lat lons
lats = seq(-90,90,length.out=9); lons = seq(-180,180,length.out=9)

#multiple lat lons but single bearings / distances
destination(lats,lons,bearing=45,distance=500000)

#different bearings for each lat lon
destination(lats,lons,bearing=seq(0,360,length.out=9),distance=500000)

#different distances for each lat lon
destination(lats,lons,bearing=45,distance=seq(0,5000000,length.out=9))

#different bearings & distances for each lat lon
destination(lats,lons,bearing=seq(0,360,length.out=9),
    distance=seq(0,5000000,length.out=9))

Example output

  lon1 lat1 bearing distance lon2      lat2
1  165  -85     180    5e+05  165 -89.48412
  lon1 lat1 bearing distance     lon2      lat2
1  165  -85       0    5e+05 165.0000 -80.51547
2  165  -85      45    5e+05 186.2767 -81.23674
3  165  -85      90    5e+05 206.9805 -83.28751
4  165  -85     135    5e+05 225.0793 -86.34296
5  165  -85     180    5e+05 165.0000 -89.48412
6  165  -85     225    5e+05 104.9207 -86.34296
7  165  -85     270    5e+05 123.0195 -83.28751
8  165  -85     315    5e+05 143.7233 -81.23674
9  165  -85     360    5e+05 165.0000 -80.51547
   lon1 lat1 bearing distance     lon2      lat2
1   165  -85      45        0 165.0000 -85.00000
2   165  -85      45   500000 186.2767 -81.23674
3   165  -85      45  1000000 194.3648 -77.00867
4   165  -85      45  1500000 198.4876 -72.65156
5   165  -85      45  2000000 200.9868 -68.24188
6   165  -85      45  2500000 202.6751 -63.80524
7   165  -85      45  3000000 203.9030 -59.35241
8   165  -85      45  3500000 204.8455 -54.88866
9   165  -85      45  4000000 205.5997 -50.41686
10  165  -85      45  4500000 206.2236 -45.93872
11  165  -85      45  5000000 206.7542 -41.45533
   lon1 lat1 bearing distance      lon2      lat2
1   165  -85       0        0 165.00000 -85.00000
2   165  -85      45        0 165.00000 -85.00000
3   165  -85      90        0 165.00000 -85.00000
4   165  -85     135        0 165.00000 -85.00000
5   165  -85     180        0 165.00000 -85.00000
6   165  -85     225        0 165.00000 -85.00000
7   165  -85     270        0 165.00000 -85.00000
8   165  -85     315        0 165.00000 -85.00000
9   165  -85     360        0 165.00000 -85.00000
10  165  -85       0   500000 165.00000 -80.51547
11  165  -85      45   500000 186.27674 -81.23674
12  165  -85      90   500000 206.98052 -83.28751
13  165  -85     135   500000 225.07926 -86.34296
14  165  -85     180   500000 165.00000 -89.48412
15  165  -85     225   500000 104.92074 -86.34296
16  165  -85     270   500000 123.01948 -83.28751
17  165  -85     315   500000 143.72326 -81.23674
18  165  -85     360   500000 165.00000 -80.51547
19  165  -85       0  1000000 165.00000 -76.03018
20  165  -85      45  1000000 194.36480 -77.00867
21  165  -85      90  1000000 226.08902 -79.74152
22  165  -85     135  1000000 267.14337 -83.52598
23  165  -85     180  1000000 345.00000 -86.03181
24  165  -85     225  1000000  62.85663 -83.52598
25  165  -85     270  1000000 103.91098 -79.74152
26  165  -85     315  1000000 135.63520 -77.00867
27  165  -85     360  1000000 165.00000 -76.03018
28  165  -85       0  1500000 165.00000 -71.54378
29  165  -85      45  1500000 198.48759 -72.65156
30  165  -85      90  1500000 234.97881 -75.66280
31  165  -85     135  1500000 280.68253 -79.48211
32  165  -85     180  1500000 345.00000 -81.54741
33  165  -85     225  1500000  49.31747 -79.48211
34  165  -85     270  1500000  95.02119 -75.66280
35  165  -85     315  1500000 131.51241 -72.65156
36  165  -85     360  1500000 165.00000 -71.54378
37  165  -85       0  2000000 165.00000 -67.05596
38  165  -85      45  2000000 200.98685 -68.24188
39  165  -85      90  2000000 239.92864 -71.39773
40  165  -85     135  2000000 286.60774 -75.18329
41  165  -85     180  2000000 345.00000 -77.06232
42  165  -85     225  2000000  43.39226 -75.18329
43  165  -85     270  2000000  90.07136 -71.39773
44  165  -85     315  2000000 129.01315 -68.24188
45  165  -85     360  2000000 165.00000 -67.05596
46  165  -85       0  2500000 165.00000 -62.56645
47  165  -85      45  2500000 202.67511 -63.80524
48  165  -85      90  2500000 243.07011 -67.04909
49  165  -85     135  2500000 289.89284 -70.79914
50  165  -85     180  2500000 345.00000 -72.57621
51  165  -85     225  2500000  40.10716 -70.79914
52  165  -85     270  2500000  86.92989 -67.04909
53  165  -85     315  2500000 127.32489 -63.80524
54  165  -85     360  2500000 165.00000 -62.56645
55  165  -85       0  3000000 165.00000 -58.07500
56  165  -85      45  3000000 203.90296 -59.35241
57  165  -85      90  3000000 245.25162 -62.65581
58  165  -85     135  3000000 291.98889 -66.37620
59  165  -85     180  3000000 345.00000 -68.08874
60  165  -85     225  3000000  38.01111 -66.37620
61  165  -85     270  3000000  84.74838 -62.65581
62  165  -85     315  3000000 126.09704 -59.35241
63  165  -85     360  3000000 165.00000 -58.07500
64  165  -85       0  3500000 165.00000 -53.58143
65  165  -85      45  3500000 204.84548 -54.88866
66  165  -85      90  3500000 246.86769 -58.23553
67  165  -85     135  3500000 293.45408 -61.93185
68  165  -85     180  3500000 345.00000 -63.59964
69  165  -85     225  3500000  36.54592 -61.93185
70  165  -85     270  3500000  83.13231 -58.23553
71  165  -85     315  3500000 125.15452 -54.88866
72  165  -85     360  3500000 165.00000 -53.58143
73  165  -85       0  4000000 165.00000 -49.08560
74  165  -85      45  4000000 205.59967 -50.41686
75  165  -85      90  4000000 248.12472 -53.79729
76  165  -85     135  4000000 294.54626 -57.47396
77  165  -85     180  4000000 345.00000 -59.10866
78  165  -85     225  4000000  35.45374 -57.47396
79  165  -85     270  4000000  81.87528 -53.79729
80  165  -85     315  4000000 124.40033 -50.41686
81  165  -85     360  4000000 165.00000 -49.08560
82  165  -85       0  4500000 165.00000 -44.58742
83  165  -85      45  4500000 206.22359 -45.93872
84  165  -85      90  4500000 249.14066 -49.34619
85  165  -85     135  4500000 295.40047 -53.00656
86  165  -85     180  4500000 345.00000 -54.61559
87  165  -85     225  4500000  34.59953 -53.00656
88  165  -85     270  4500000  80.85934 -49.34619
89  165  -85     315  4500000 123.77641 -45.93872
90  165  -85     360  4500000 165.00000 -44.58742
91  165  -85       0  5000000 165.00000 -40.08688
92  165  -85      45  5000000 206.75418 -41.45533
93  165  -85      90  5000000 249.98779 -44.88534
94  165  -85     135  5000000 296.09422 -48.53192
95  165  -85     180  5000000 345.00000 -50.12029
96  165  -85     225  5000000  33.90578 -48.53192
97  165  -85     270  5000000  80.01221 -44.88534
98  165  -85     315  5000000 123.24582 -41.45533
99  165  -85     360  5000000 165.00000 -40.08688
  lon1  lat1 bearing distance        lon2       lat2
1 -180 -90.0      45    5e+05 -135.000000 -85.515907
2 -135 -67.5      45    5e+05 -127.717000 -64.140175
3  -90 -45.0      45    5e+05  -85.749336 -41.734728
4  -45 -22.5      45    5e+05  -41.639949 -19.274173
5    0   0.0      45    5e+05    3.176623   3.193071
6   45  22.5      45    5e+05   48.518228  25.651625
7   90  45.0      45    5e+05   94.748702  48.087166
8  135  67.5      45    5e+05  144.499670  70.428481
9  180  90.0      45    5e+05  315.000000  85.515907
  lon1  lat1 bearing distance          lon2       lat2
1 -180 -90.0       0    5e+05 -1.800000e+02 -85.515907
2 -135 -67.5      45    5e+05 -1.277170e+02 -64.140175
3  -90 -45.0      90    5e+05 -8.366621e+01 -44.824007
4  -45 -22.5     135    5e+05 -4.148177e+01 -25.651625
5    0   0.0     180    5e+05  5.502676e-16  -4.514189
6   45  22.5     225    5e+05  4.163995e+01  19.274173
7   90  45.0     270    5e+05  8.366621e+01  44.824007
8  135  67.5     315    5e+05  1.255003e+02  70.428481
9  180  90.0     360    5e+05  0.000000e+00  85.515907
  lon1  lat1 bearing distance       lon2      lat2
1 -180 -90.0      45        0 -180.00000 -90.00000
2 -135 -67.5      45   625000 -126.17124 -63.25135
3  -90 -45.0      45  1250000  -80.13712 -36.57743
4  -45 -22.5      45  1875000  -32.99689 -10.13013
5    0   0.0      45  2500000   16.28258  15.75991
6   45  22.5      45  3125000   70.80455  40.24084
7   90  45.0      45  3750000  141.53713  59.98943
8  135  67.5      45  4375000  239.64657  62.45299
9  180  90.0      45  5000000  315.00000  45.10506
  lon1  lat1 bearing distance          lon2       lat2
1 -180 -90.0       0        0 -1.800000e+02 -90.000000
2 -135 -67.5      45   625000 -1.261712e+02 -63.251354
3  -90 -45.0      90  1250000 -7.433028e+01 -43.911517
4  -45 -22.5     135  1875000 -3.074451e+01 -33.797267
5    0   0.0     180  2500000  2.896532e-15 -22.563681
6   45  22.5     225  3125000  2.557305e+01   1.623163
7   90  45.0     270  3750000  4.672582e+01  36.021757
8  135  67.5     315  4375000  3.035343e+01  62.452993
9  180  90.0     360  5000000  0.000000e+00  45.105056

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.