car2sph | R Documentation |
Transforms 3D cartesian coordinates to spherical coordinates. The user can choose to return the spherical coordinates in degrees or radians.
car2sph(x, y, z, deg = TRUE)
x |
x values, can also contain a matrix of x, y and z (in that order). |
y |
y values. |
z |
z values |
deg |
Should degrees be returned (default) or radians. |
This is a low level function that is used for plot transformations.
A data.frame is returned containing the columns long (longitude), lat (latitude) and radius.
Aaron Robotham
rgl.sphgrid
,rgl.sphcirc
,rgl.sphpoints
,rgl.sphtext
,rgl.sphsun
,rgl.sphMW
,pointsphere
,sph2car
print(car2sph(x=1,y=1,z=0,deg=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.