sl.p2p: Compute Point Between Points on Sphere

View source: R/sl.p2p.R

sl.p2pR Documentation

Compute Point Between Points on Sphere

Description

Compute a point on a great-circle line moving a certain fraction from a start point towards an end point.

Usage

sl.p2p(lon1, lat1, lon2, lat2, frac)

Arguments

lon1

a scalar giving the longitude of the start point.

lat1

a scalar giving the latitude of the start point.

lon2

a scalar giving the longitude of the end point.

lat2

a scalar giving the latitude of the start point.

frac

a scalar giving the fraction how much of the distance from the start point to the end point shall be covered. Values below 0 or above 1 are valid and result in points outside the connecting line between the start and end points.

Value

lon

a scalar giving the longitude of the resulting point.

lat

a scalar giving the latitude of the resulting point.

Author(s)

Helge Goessling

See Also

sl.fillequidist

Examples

sl.p2p(lon1=0,lat1=0,lon2=90,lat2=40,frac=0.5)
## Should return:
## $lon
## [1] 37.45372
## 
## $lat
## [1] 27.03402

helgegoessling/spheRlab documentation built on April 8, 2024, 8:34 a.m.