dgeodr_c |

Table of contents## Proceduredgeodr_c ( Derivative of geodetic w.r.t. rectangular ) void dgeodr_c ( SpiceDouble x, SpiceDouble y, SpiceDouble z, SpiceDouble re, SpiceDouble f, SpiceDouble jacobi[3][3] ) ## AbstractCompute the Jacobian matrix of the transformation from rectangular to geodetic coordinates. ## Required_ReadingNone. ## KeywordsCOORDINATES DERIVATIVES MATRIX ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- x I X-coordinate of point. y I Y-coordinate of point. z I Z-coordinate of point. re I Equatorial radius of the reference spheroid. f I Flattening coefficient. jacobi O Matrix of partial derivatives. ## Detailed_Inputx, y, z are the rectangular coordinates of the point at which the Jacobian of the map from rectangular to geodetic coordinates is desired. re Equatorial radius of the reference spheroid. f Flattening coefficient = (re-rp) / re, where rp is the polar radius of the spheroid. (More importantly rp = re*(1-f).) ## Detailed_Outputjacobi is the matrix of partial derivatives of the conversion between rectangular and geodetic coordinates. It has the form .- -. | dlon/dx dlon/dy dlon/dz | | dlat/dx dlat/dy dlat/dz | | dalt/dx dalt/dy dalt/dz | `- -' evaluated at the input values of x, y, and z. ## ParametersNone. ## Exceptions1) If the input point is on the Z-axis (X and Y = 0), the Jacobian is undefined, the error SPICE(POINTONZAXIS) is signaled by a routine in the call tree of this routine. 2) If the flattening coefficient is greater than or equal to one, the error SPICE(VALUEOUTOFRANGE) is signaled by a routine in the call tree of this routine. 3) If the equatorial radius is not positive, the error SPICE(BADRADIUS) is signaled by a routine in the call tree of this routine. ## FilesNone. ## ParticularsWhen performing vector calculations with velocities it is usually most convenient to work in rectangular coordinates. However, once the vector manipulations have been performed, it is often desirable to convert the rectangular representations into geodetic coordinates to gain insights about phenomena in this coordinate frame. To transform rectangular velocities to derivatives of coordinates in a geodetic system, one uses the Jacobian of the transformation between the two systems. Given a state in rectangular coordinates ( x, y, z, dx, dy, dz ) the velocity in geodetic coordinates is given by the matrix equation: t | t (dlon, dlat, dalt) = jacobi| * (dx, dy, dz) |(x,y,z) This routine computes the matrix | jacobi| |(x, y, z) ## ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Find the geodetic state of the earth as seen from Mars in the IAU_MARS reference frame at January 1, 2005 TDB. Map this state back to rectangular coordinates as a check. Use the meta-kernel shown below to load the required SPICE kernels. KPL/MK File name: dgeodr_ex1.tm This meta-kernel is intended to support operation of SPICE example programs. The kernels shown here should not be assumed to contain adequate or correct versions of data required by SPICE-based user applications. In order for an application to use this meta-kernel, the kernels referenced here must be present in the user's current working directory. The names and contents of the kernels referenced by this meta-kernel are as follows: File name Contents --------- -------- de421.bsp Planetary ephemeris pck00010.tpc Planet orientation and radii naif0009.tls Leapseconds \begindata KERNELS_TO_LOAD = ( 'de421.bsp', 'pck00010.tpc', 'naif0009.tls' ) \begintext End of meta-kernel Example code begins here. /. Program dgeodr_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local variables ./ SpiceDouble alt; SpiceDouble drectn [3]; SpiceDouble et; SpiceDouble f; SpiceDouble jacobi [3][3]; SpiceDouble lat; SpiceDouble lon; SpiceDouble lt; SpiceDouble geovel [3]; SpiceDouble radii [3]; SpiceDouble re; SpiceDouble rectan [3]; SpiceDouble rp; SpiceDouble state [6]; SpiceInt n; /. Load SPK, PCK, and LSK kernels, use a meta kernel for convenience. ./ furnsh_c ( "dgeodr_ex1.tm" ); /. Look up the radii for Mars. Although we omit it here, we could first call badkpv_c to make sure the variable BODY499_RADII has three elements and numeric data type. If the variable is not present in the kernel pool, bodvrd_c will signal an error. ./ bodvrd_c ( "MARS", "RADII", 3, &n, radii ); /. Compute flattening coefficient. ./ re = radii[0]; rp = radii[2]; f = ( re - rp ) / re; /. Look up the apparent state of earth as seen from Mars at January 1, 2005 TDB, relative to the IAU_MARS reference frame. ./ str2et_c ( "January 1, 2005 TDB", &et ); spkezr_c ( "Earth", et, "IAU_MARS", "LT+S", "Mars", state, < ); /. Convert position to geodetic coordinates. ./ recgeo_c ( state, re, f, &lon, &lat, &alt ); /. Convert velocity to geodetic coordinates. ./ ## RestrictionsNone. ## Literature_ReferencesNone. ## Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.L. Taber (JPL) ## Version-CSPICE Version 1.0.1, 01-NOV-2021 (JDR) Edited the header to comply with NAIF standard. Added complete code example. -CSPICE Version 1.0.0, 18-JUL-2001 (WLT) (NJB) ## Index_EntriesJacobian of geodetic w.r.t. rectangular coordinates |

Fri Dec 31 18:41:04 2021