car2sph: Spherical coordinates

Description Usage Arguments Value Author(s)

View source: R/car2sph.R

Description

Transform a 3D vector constituting a cartesian coordinate set to spherical coordinates

Usage

1
car2sph(X, deg = FALSE, rep = "sph", unitlength = TRUE)

Arguments

X

A numerical vector or matrix whos entries constitute a cartesian coordinate. A vector should have 3 entries and a matrix should have 3 columns.

deg

Logical value indicating whether the output should be in randians or degrees. Radian is default.

rep

Determine the representation of the spherical coordinates. If "sph" long will range from 0 to 2 * pi and lat will range from 0 to pi. The classical representation of spherical coordinates in radians. If "geo" long will range from -pi to pi and lat will range from 0 to pi. The geografical representation in radians. Deafult is "sph".

unitlength

Logical values indicating if the points should be returned with unit length. If TRUE (default) r will be set to 1.

Value

A data.frame with 3 columns longitude, latitude and radial distance.

Author(s)

Andreas Dyreborg Christoffersen andreas@math.aau.dk


adchSTATS/spatstatsphadd documentation built on May 28, 2019, 3:54 p.m.