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