convert_spherical_to_cartesian {nprotreg} | R Documentation |
Converts Spherical to Cartesian Coordinates.
Description
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.
Usage
convert_spherical_to_cartesian(spherical_coords)
Arguments
spherical_coords |
A matrix of rows containing the longitude and latitude, measured in radians, of specific points on a 3-dimensional sphere. |
Value
A matrix whose rows contain the Cartesian coordinates of the specified points.
See Also
http://mathworld.wolfram.com/SphericalCoordinates.html.
Other Conversion functions:
convert_cartesian_to_spherical()
Examples
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)
[Package nprotreg version 1.1.1 Index]