sl.fillequidist: Insert Points into Line on Sphere

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sl.fillequidist.R

Description

Insert points at equidistant locations along a line on a sphere. Note that the algorithm works in x-y-z coordinates. This means that, if more than one point is added, the points are not exactly equidistant in terms of great-circle distances after projection onto the sphere, with deviations becoming large for long lines. (See sl.p2p for a more precise alternative where arbitrary fractions can be specified.)

Usage

1
sl.fillequidist(lon, lat, np = 1)

Arguments

lon

a vector of length 2 with the longitudes of the start and end points of the line.

lat

a vector of length 2 with the latitudes of the start and end points of the line.

np

an integer giving the number of points to be inserted. Default is 1 (in which case the algorithm is exact even for long lines).

Value

lon

a vector of length np with the longitude(s) of the inserted points.

lat

a vector of length np with the latitude(s) of the inserted points.

Author(s)

Helge Goessling

See Also

sl.p2p

Examples

1
2
3
4
5
6
7
sl.fillequidist(c(0,10),c(0,0),np=2)
## Should return:
## $lon
## [1] 3.329563 6.670437
## 
## $lat
## [1] 0 0

helgegoessling/spheRlab documentation built on Sept. 29, 2017, 6:36 a.m.