cartesian2spherical.Rd
Cartesian to spherical coordinate conversion.
cartesian2spherical(x, y = NULL, z = NULL)
x | a vector of x coordinates (or a vector of length 3 holding \(x, y, z\)) |
---|---|
y | a vector of y coordinates |
z |
A vector of three spherical coordinates \(r, theta, phi\) of a point represented as \(x, y, z\) in Cartesian coordinates.
cartesian2spherical(0, 0, 0)#> $r #> [1] 0 #> #> $theta #> [1] 0 #> #> $phi #> [1] 0 #>cartesian2spherical(1, 2, 3)#> $r #> [1] 3.741657 #> #> $theta #> [1] 0.6405223 #> #> $phi #> [1] 1.107149 #>#> $r #> [1] 3.741657 #> #> $theta #> [1] 0.6405223 #> #> $phi #> [1] 1.107149 #>