View source: R/convert_cartesian_to_spherical.R
convert_cartesian_to_spherical | R Documentation |
The Cartesian coordinates of points on a 3-dimensional sphere with unit radius and center at the origin are converted to the equivalent longitude and latitude coordinates, measured in radians.
convert_cartesian_to_spherical(cartesian_coords)
cartesian_coords |
A matrix whose rows contain the Cartesian coordinates of the specified points. |
A matrix of rows containing the longitude and latitude of specific points on a 3-dimensional sphere.
http://mathworld.wolfram.com/SphericalCoordinates.html.
Other Conversion functions:
convert_spherical_to_cartesian()
library(nprotreg)
# Define the Cartesian coordinates of the North and South Poles.
north_pole <- cbind(0, 0, 1)
south_pole <- cbind(0, 0, -1)
cartesian_coords <- rbind(north_pole, south_pole)
# Get the corresponding Spherical coordinates.
spherical_coords <- convert_cartesian_to_spherical(cartesian_coords)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.