CSPICE_DRDSPH computes the Jacobian of the transformation from
spherical to rectangular coordinates.
r the distance of a point from the origin.
[1,n] = size(r); double = class(r)
colat the angle between the point and the positive z-axis, in radians.
[1,n] = size(colat); double = class(colat)
lon the angle of the point measured from the xz plane in radians.
The angle increases in the counterclockwise sense about
the +z axis.
[1,n] = size(lon); double = class(lon)
jacobi = cspice_drdsph( r, colat, lon)
jacobi the matrix of partial derivatives of the conversion between
spherical and rectangular coordinates, evaluated at the input
coordinates. This matrix has the form
If [1,1] = size(r) then [3,3] = size(jacobi)
If [1,n] = size(r) then [3,3,n] = size(jacobi)
double = class(jacobi)
| dx/dr dx/dcolat dx/dlon |
| dy/dr dy/dcolat dy/dlon |
| dz/dr dz/dcolat dz/dlon |
evaluated at the input values of r, lon and lat.
Here x, y, and z are given by the familiar formulae
x = r*cos(lon)*sin(colat)
y = r*sin(lon)*sin(colat)
z = r*cos(colat)
It is often convenient to describe the motion of an object in
the spherical coordinate system. However, when performing
vector computations its hard to beat rectangular coordinates.
To transform states given with respect to spherical coordinates
to states with respect to rectangular coordinates, one uses
the Jacobian of the transformation between the two systems.
Given a state in spherical coordinates
( r, colat, lon, dr, dcolat, dlon )
the velocity in rectangular coordinates is given by the matrix
t | t
(dx, dy, dz) = jacobi| * (dr, dcolat, dlon )
This routine computes the matrix
For important details concerning this module's function, please refer to
the CSPICE routine drdsph_c.
-Mice Version 1.0.0, 09-NOV-2012, EDW (JPL), SCK (JPL)
Jacobian of rectangular w.r.t. spherical coordinates