Learn R Programming

spherepc (version 0.1.7)

Trans.sph: Transforming into spherical coordinate

Description

This function converts a Euclidean coordinate to a spherical coordinate.

Usage

Trans.sph(vec)

Arguments

vec

three-dimensional Euclidean coordinate.

Value

two-dimensional vector.

Details

This function converts a three-dimensional Euclidean coordinate to a two-dimensional spherical coordinate. If vec is not in the unit sphere, it is divided by its magnitude so that the result lies on the unit sphere.

See Also

Trans.Euclid.

Examples

Run this code
# NOT RUN {
Trans.sph(c(1, 0, 0))
Trans.sph(c(0, 1, 0))
Trans.sph(c(0, 0, 1))
Trans.sph(c(-1, 0 , 0))
Trans.sph(c(0, -1, 0))
# }

Run the code above in your browser using DataLab