s2point: Single point on the (unit) sphere

View source: R/s2point.R

s2pointR Documentation

Single point on the (unit) sphere

Description

Make an object of class "s2point" representing a single point on the unit sphere.

Usage

s2point(...)

Arguments

...

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.

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.

Value

Object of class "s2point" which is a numeric of length 3.

Examples

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)


spatstat/spatstat.sphere documentation built on Jan. 27, 2023, 2:59 a.m.