Index Page
cspice_recgeo
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_RECGEO converts rectangular coordinates to geodetic
   coordinates.

I/O


   Given:

      rectan   the array(s) containing the rectangular coordinates of the
               position or set of positions.

               [3,n] = size(rectan); double = class(rectan)

       re      the value describing equatorial radius of the body
               of interest.

               [1,1] = size(re); double = class(re)

       f       the value describing flattening coefficient of the body,
               a dimensionless value defined as:

                    equatorial_radius - polar_radius
                    --------------------------------
                           equatorial_radius

               [1,1] = size(f); double = class(f)

   the call:

      [ lon, lat, alt ] = cspice_recgeo( rectan, re, f)

   returns:

       lon   the value(s) describing the geodetic longitude
             measured in radians.

             [1,n] = size(lon); double = class(lon)

       lat   the value(s) describing the geodetic latitude
             measured in radians.

             [1,n] = size(lat); double = class(lat)

       alt   the value(s) describing the altitude above the
             reference spheroid.

             [1,n] = size(alt); double = class(alt)

             'lon', 'lat', and 'alt' return with the same vectorization
             measure, N, as 'rectan'.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

      %
      % Load the standard kernel set.
      %
      cspice_furnsh( 'standard.tm' )

      %
      % Retrieve the triaxial radii of the earth
      %
      radii = cspice_bodvrd( 'EARTH', 'RADII', 3 );

      %
      % Calculate the flatness coefficient. Set a bodyfixed
      % position.
      %
      flat = (radii(1) - radii(3))/radii(1);
      x    = [ -2541.748162; 4780.333036; 3360.428190];

      [ lon, lat, alt] = cspice_recgeo( x, radii(1), flat );

      %
      % Output, convert the angular values to degrees.
      %
      lon = lon * cspice_dpr;
      lat = lat * cspice_dpr;

      disp('Scalar:')
      txt = sprintf( '%12.8f   %12.8f   %12.8f', lon , lat , alt );
      disp( txt )

      disp(' ')

      %
      % Using the equatorial radius of the Clark66 spheroid
      % (CLARKR = 6378.2064 km) and the Clark 66 flattening
      % factor (CLARKF = 1.0 / 294.9787 ) convert to
      % body fixed rectangular coordinates.
      %
      CLARKR = 6378.2064;
      CLARKF = 1./294.9787;

      x = [ [ 0, 1, 0, 0, -1,  0,  0, 1, 1, 0, 1];
            [ 0, 0, 1, 0,  0, -1,  0, 1, 0, 1, 1];
            [ 0, 0, 0, 1,  0,  0, -1, 0, 1, 1, 1] ];

      [ lon, lat, alt] = cspice_recgeo(  x, CLARKR, CLARKF );

      %
      % Output, convert the angular values to degrees.
      %
      lon = lon * cspice_dpr;
      lat = lat * cspice_dpr;

      disp('Vector:')

      %
      % Output banner.
      %
    disp('    lon        lat          alt         x          y          z    ')
    disp('  --------   --------   ----------   --------   --------   --------')

      output = [ lon; lat; alt; x(1,:); x(2,:); x(3,:) ];
      txt    = sprintf( '%10.4f %10.4f %12.6f %10.4f %10.4f %10.4f\n',output);
      disp(txt)

      %
      % It's always good form to unload kernels after use,
      % particularly in MATLAB due to data persistence.
      %
      cspice_kclear

   MATLAB outputs:

      Scalar:
         118.00000000    32.00000000     0.00000024

      118 degrees west, 32 north, 0.24 mm altitude.

   Vector:
       lon        lat          alt         x          y          z
     --------   --------   ----------   --------   --------   --------
       0.0000    90.0000 -6356.583800     0.0000     0.0000     0.0000
       0.0000    88.6772 -6356.572258     1.0000     0.0000     0.0000
      90.0000    88.6772 -6356.572258     0.0000     1.0000     0.0000
       0.0000    90.0000 -6355.583800     0.0000     0.0000     1.0000
     180.0000    88.6772 -6356.572258    -1.0000     0.0000     0.0000
     -90.0000    88.6772 -6356.572258     0.0000    -1.0000     0.0000
       0.0000   -90.0000 -6355.583800     0.0000     0.0000    -1.0000
      45.0000    88.1291 -6356.560715     1.0000     1.0000     0.0000
       0.0000    88.7071 -6355.572518     1.0000     0.0000     1.0000
      90.0000    88.7071 -6355.572518     0.0000     1.0000     1.0000
      45.0000    88.1714 -6355.561236     1.0000     1.0000     1.0000

Particulars


   None.

Required Reading


   For important details concerning this module's function, please refer to
   the CSPICE routine recgeo_c.

   MICE.REQ

Version


   -Mice Version 1.0.1, 01-DEC-2014, EDW (JPL)

       Edited I/O section to conform to NAIF standard for Mice documentation.

   -Mice Version 1.0.0, 22-NOV-2005, EDW (JPL)

Index_Entries


   rectangular to geodetic


Wed Apr  5 18:00:34 2017