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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_GEOREC converts geodetic coordinates to rectangular
   coordinates.

I/O


   Given:

      lon      the geodetic longitude of the input point, or an N-vector
               of longitudes.

               help, lon
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               This is the angle between the prime meridian and the meridian
               containing `rectan'. The direction of increasing longitude is
               from the +X axis towards the +Y axis.

               Longitude is measured in radians. On input, the
               range of longitude is unrestricted.

      lat      the geodetic latitude of the input point, or an N-vector
               of latitudes.

               help, lat
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               For a point P on the reference spheroid, this is the angle
               between the XY plane and the outward normal vector at P. For a
               point P not on the reference spheroid, the geodetic latitude is
               that of the closest point to P on the spheroid.

               Latitude is measured in radians. On input, the
               range of latitude is unrestricted.

      alt      the altitude of point above the reference spheroid, or an
               N-vector of altitudes.

               help, alt
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

               `alt' must be in the same units as `re'.

      re       the equatorial radius of a reference spheroid.

               help, re
                  DOUBLE = Scalar

               This spheroid is a volume of revolution: its horizontal cross
               sections are circular. The shape of the spheroid is defined by
               an equatorial radius `re' and a polar radius RP. `re' must be in
               the same units as `alt'.

      f        the flattening coefficient = (re-rp) / re, where `rp' is the
               polar radius of the spheroid.

               help, f
                  DOUBLE = Scalar

   the call:

      cspice_georec, lon, lat, alt, re, f, rectan

   returns:

      rectan   the rectangular coordinates of a point, or an N-vector of
               coordinates.

               help, rectan
                  DOUBLE = Array[3]   or   DOUBLE = Array[3,N]

               The units associated with `rectan' are those associated
               with the inputs `alt' and `re'.

               `rectan' returns with the same measure of vectorization (N)
               as `lon', `lat', and `alt'.

Parameters


   None.

Examples


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

   1) Find the rectangular coordinates of the point having Earth
      geodetic coordinates:

         lon (deg) =  118.0
         lat (deg) =   32.0
         alt (km)  =    0.0

      Use the PCK kernel below to load the required triaxial
      ellipsoidal shape model and orientation data for the Earth.

         pck00010.tpc


      Example code begins here.


      PRO georec_ex1

         ;;
         ;; Load a PCK file containing a triaxial
         ;; ellipsoidal shape model and orientation
         ;; data for the Earth.
         ;;
         cspice_furnsh, 'pck00010.tpc'

         ;;
         ;; Retrieve the triaxial radii of the Earth
         ;;
         cspice_bodvrd, 'EARTH', 'RADII', 3, radii

         ;;
         ;; Compute flattening coefficient.
         ;;
         re  =  radii[0]
         rp  =  radii[2]
         f   =  ( re - rp ) / re

         ;;
         ;; Set a geodetic position.
         ;;
         lon = 118.0d * cspice_rpd( )
         lat =  30.0d * cspice_rpd( )
         alt =   0.0d

         ;;
         ;; Do the conversion.
         ;;
         cspice_georec, lon, lat, alt, radii[0], f, rectan

         print, 'Geodetic coordinates in deg and km (lon, lat, alt)'
         print, format='(3F14.6)', lon * cspice_dpr( ),                      $
                                   lat * cspice_dpr( ),                      $
                                   alt
         print, 'Rectangular coordinates in km (x, y, z)'
         print, format='(3F14.6)', rectan[0], rectan[1], rectan[2]

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

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Geodetic coordinates in deg and km (lon, lat, alt)
          118.000000     30.000000      0.000000
      Rectangular coordinates in km (x, y, z)
        -2595.359123   4881.160589   3170.373523


   2) Create a table showing a variety of rectangular coordinates
      and the corresponding Earth geodetic coordinates. The
      values are computed using the equatorial radius of the Clark
      66 spheroid and the Clark 66 flattening factor:

         radius: 6378.2064
         flattening factor: 1./294.9787

      Note: the values shown above may not be current or suitable
            for your application.


      Corresponding rectangular and geodetic coordinates are
      listed to three decimal places. Input angles are in degrees.


      Example code begins here.


      PRO georec_ex2

         ;;
         ;; Local parameters.
         ;;
         NREC = 11

         ;;
         ;; Define the input geodetic coordinates. Angles in
         ;; degrees.
         ;;
         lon = [ 0.0d,  0.0d, 90.0d,  0.0d,  180.0d, -90.0d,                 $
                 0.0d, 45.0d,  0.0d,  90.0d,  45.0d ]

         lat = [  90.0d, 0.0d,  0.0d,   90.0d,    0.0d,   0.0d,              $
                 -90.0d, 0.0d, 88.707d, 88.707d, 88.1713d     ]

         alt = [ -6356.5838, 0.0,     0.0,        0.0,        0.0,   0.0,    $
                     0.0,    0.0, -6355.5725, -6355.5725, -6355.5612    ]

         ;;
         ;; Using the equatorial radius of the Clark66 spheroid
         ;; (clarkr = 6378.2064 km) and the Clark 66 flattening
         ;; factor (clarkf = 1.0 / 294.9787 ) convert from
         ;; body fixed rectangular coordinates.
         ;;
         clarkr = 6378.2064
         clarkf = 1.0 / 294.9787

         ;;
         ;; Print the banner.
         ;;
         print, '    lon      lat       alt     rectan[0]  rectan[1] ' +     $
                ' rectan[2]'
         print, '  -------  -------  ---------  ---------  --------- ' +     $
                ' ---------'

         ;;
         ;; Do the conversion.
         ;;
         rlon = lon * cspice_rpd()
         rlat = lat * cspice_rpd()

         cspice_georec, rlon, rlat, alt, clarkr, clarkf, rectan

         for i=0, NREC - 1L do begin

            print, format='(2F9.3,F11.3,$)', lon[i], lat[i], alt[i]
            print, format='(3F11.3)', rectan[*,i]

         endfor

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


          lon      lat       alt     rectan[0]  rectan[1]  rectan[2]
        -------  -------  ---------  ---------  ---------  ---------
          0.000   90.000  -6356.584      0.000      0.000     -0.000
          0.000    0.000      0.000   6378.207      0.000      0.000
         90.000    0.000      0.000      0.000   6378.207      0.000
          0.000   90.000      0.000      0.000      0.000   6356.584
        180.000    0.000      0.000  -6378.207      0.000      0.000
        -90.000    0.000      0.000      0.000  -6378.207      0.000
          0.000  -90.000      0.000      0.000      0.000  -6356.584
         45.000    0.000      0.000   4510.073   4510.073      0.000
          0.000   88.707  -6355.572      1.000      0.000      1.000
         90.000   88.707  -6355.572      0.000      1.000      1.000
         45.000   88.171  -6355.561      1.000      1.000      1.000


Particulars


   Given the geodetic coordinates of a point, and the constants
   describing the reference spheroid,  this routine returns the
   bodyfixed rectangular coordinates of the point. The bodyfixed
   rectangular frame is that having the X-axis pass through the
   0 degree latitude 0 degree longitude point. The Y-axis passes
   through the 0 degree latitude 90 degree longitude. The Z-axis
   passes through the 90 degree latitude point. For some bodies
   this coordinate system may not be a right-handed coordinate
   system.

Exceptions


   1)  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.

   2)  If the equatorial radius is less than or equal to zero, the
       error SPICE(VALUEOUTOFRANGE) is signaled by a routine in the
       call tree of this routine.

   3)  If any of the input arguments, `lon', `lat', `alt', `re' or
       `f', is undefined, an error is signaled by the IDL error
       handling system.

   4)  If any of the input arguments, `lon', `lat', `alt', `re' or
       `f', is not of the expected type, or it does not have the
       expected dimensions and size, an error is signaled by the Icy
       interface.

   5)  If the input vectorizable arguments `lon', `lat' and `alt' do
       not have the same measure of vectorization (N), an error is
       signaled by the Icy interface.

   6)  If the output argument `rectan' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   [1]  R. Bate, D. Mueller, and J. White, "Fundamentals of
        Astrodynamics," Dover Publications Inc., 1971.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.1.2, 01-NOV-2021 (JDR)

       Edited the header to comply with NAIF standard. Improved the
       arguments' documentation. Split the existing code example into
       two separate examples.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.1.1, 05-FEB-2008 (EDW)

       Edited -I/O section, replaced comment

          "returns with the same order"

       with

          "returns with the same measure of vectorization"

   -Icy Version 1.1.0, 12-SEP-2004 (EDW)

       Added capability to process vectors 'lon',
       'lat', and 'alt' as input returning
       vector 'rectan' on output.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   geodetic to rectangular coordinates



Fri Dec 31 18:43:04 2021