Trans.sph: Transforming into spherical coordinate

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/spherepc.R

Description

This function converts a Euclidean coordinate to a spherical coordinate.

Usage

1
Trans.sph(vec)

Arguments

vec

three-dimensional Euclidean coordinate.

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.

Value

two-dimensional vector.

Author(s)

Jongmin Lee

See Also

Trans.Euclid.

Examples

1
2
3
4
5
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))

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
[1] 0 0
[1] 90  0
[1]  0 90
[1] 180   0
[1] -90   0

spherepc documentation built on Oct. 7, 2021, 9:14 a.m.

Related to Trans.sph in spherepc...