spherical2cartesian.Rd
spherical2cartesian
provides spherical to
Cartesian coordinate conversion.
spherical2cartesian(r, theta = NULL, phi = NULL)
r | a vector of radii (or a vector of length 3 holding \(r, theta, phi\)) |
---|---|
theta | a vector of inclinations |
phi | a vector of azimuths |
A list of \(x\), \(y\), and \(z\) Cartesian coordinates.
spherical2cartesian(1, 0, pi / 2)#> x y z #> 0 0 1spherical2cartesian(1, pi, pi / 4)#> x y z #> 8.659561e-17 8.659561e-17 -1.000000e+00#> x y z #> 8.659561e-17 8.659561e-17 -1.000000e+00