Learn R Programming

SphereOptimize (version 0.1.1)

to.Sphere: Converting Cartesian coordinates to spherical coordinates

Description

The function to.Sphere convert a list of Cartesian coordinates representing a point on a unit sphere to the corresponding spherical coordinates.

Usage

to.Sphere(s)

Arguments

s

A list of Cartesian coordinates.

Value

A vector of the corresponding angles in spherical coordinating system.

Examples

Run this code
# NOT RUN {
s = from.Sphere(c(pi/3, pi/4, pi/5))
theta = to.Sphere(s)
theta = round(theta, 5)
theta == round(c(pi/3, pi/4, pi/5), 5)
# }

Run the code above in your browser using DataLab