powered by
Converts vector between Cartesian and spherical coordinate systems
cartesian_to_spherical(n)spherical_to_cartesian(p)spherical_to_geographical(p)
spherical_to_cartesian(p)
spherical_to_geographical(p)
Functions return a (2- or 3-dimensional) vector representing a point in the requested coordinate system.
Cartesian coordinates (x, y, z) as three-column vector
Spherical coordinates (colatitude, azimuth) as two-column vector
cartesian_to_geographical() and geographical_to_cartesian() for conversions to geographical coordinates
cartesian_to_geographical()
geographical_to_cartesian()
n <- c(1, -2, 3) cartesian_to_spherical(n) p <- c(50, 10) spherical_to_cartesian(p)
Run the code above in your browser using DataLab