cartesian2spherical: Cartesian to spherical coordinate conversion.

cartesian2sphericalR Documentation

Cartesian to spherical coordinate conversion.

Description

Cartesian to spherical coordinate conversion.

Usage

cartesian2spherical(x, 
    y = NULL, z = NULL)

Arguments

x

a vector of x coordinates (or a vector of length 3 holding x, \code{y}, z, or a matrix with 3 columns holding x, \code{y}, z coordinates)

y

a vector of y coordinates

z

Value

A matrix of three spherical coordinates r, theta, phi of points represented as x, \code{y}, z in Cartesian coordinates.

Author(s)

Tomas Sieger

See Also

spherical2cartesian

Examples

cartesian2spherical(0, 0, 0)
cartesian2spherical(1, 2, 3)
cartesian2spherical(c(1, 2, 3))
cartesian2spherical(cbind(0,1,seq(0:10)))

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.