s2point | R Documentation |
Make an object of class "s2point"
representing a single point
on the unit sphere.
s2point(...)
... |
Input to interpret as a point on the sphere. Either in terms of three Eucledian coordinates (x,y,z) or two spherical coordinates (latitude,longitude). See Details. |
For three Eucledian coordinates the following type of inputs are recognised:
Three inputs with a single real number (optionally named x
, y
and z
).
A list or data.frame with three real numbers as elements (optionally named x
, y
and z
).
A single vector or matrix with three real numbers.
For two spherical coordinates a named input is required. The names can either
be given as argument names of the function or as the names of the provided
input. Input latitude is partially matched to "latitude"
and input longitude
is either partially matched to longitude
or exactly matched to lng
. In all
cases measurements are in degrees and should be in [-90,90] (latitude)
and [-180,180] (longitude).
The following type of inputs are recognised:
Two named inputs with a single real number.
A list or data.frame with two named elements containing a real number each.
A single vector with two named elements containing a real number each.
A two column matrix with a single row of real numbers and a colnames
attribute.
Object of class "s2point"
which is a numeric of length 3.
longitude <- c(90) latitude <- c(45) xyz <- s2point(lon = longitude, lat = latitude) x <- xyz[1] y <- xyz[2] z <- xyz[3] xyz2 <- s2point(x=x, y=y, z=z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.