Index Page
cspice_georec
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_GEOREC converts geodetic coordinates to rectangular 
   coordinates.

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

I/O


   Given:

       lon   a double precision scalar or N-vector describing 
             the geodetic longitude measured in radians.

       lat   a double precision scalar or N-vector describing
             the geodetic latitude measured in radians.

       alt   a double precision scalar or N-vector describing 
             the altitude above the reference spheroid.
   
       re    the scalar, double precision equatorial radius of 
             the body of interest.
 
       f     the scalar, double precision flattening coefficient
             of the body, a dimensionless value defined as:
   
                    equatorial_radius - polar_radius
                    --------------------------------
                           equatorial_radius
   
   the call:
   
      cspice_georec, lon, lat, alt, re, f, rectan

   returns:

      rectan   a double precision 3-vector or 3xN array
               containing the rectangular coordinates of the 
               position or set of positions.

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

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
      ;;
      cspice_bodvrd, 'EARTH', 'RADII', 3, radii

      ;;
      ;; Calculate the flatness coefficient. Set a latitude,
      ;; longitude, altitude coordinate set at 118 west,
      ;; 32 North, 0 altitude (convert the angular measures
      ;; to radians).
      ;;
      flat = (radii[0] - radii[2])/radii[0]
      lon  = 118.d * cspice_rpd()
      lat  = 32.d  * cspice_rpd()
      alt  = 0.d

      cspice_georec, lon, lat, alt, radii[0], flat,x
      
      print, 'Scalar:'
      print, FORMAT='( F12.6,3x, F12.6,3x, F12.6)', x
      print

      ;;
      ;; 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.2064d
      CLARKF = 1.d/294.9787d

      ;;
      ;; Define vectors of longitudes, latitudes, and altitudes.
      ;;
      lon = [  0.d, $
               0.d, $
              90.d, $ 
               0.d, $
             180.d, $
             -90.d, $
               0.d, $
              45.d, $
               0.d, $
              90.d, $
              45.d  ]

      lat = [    90.d      , $
                 88.677225d, $
                 88.677225d, $
                 90.d      , $
                 88.677225d, $
                 88.677225d, $
                -90.d      , $
                 88.129144d, $
                 88.707084d, $
                 88.707084d, $
                 88.171393d  ]

      alt = [ -6356.5838d  , $
              -6356.572258d, $
              -6356.572258d, $
              -6355.5838d  , $
              -6356.572258d, $ 
              -6356.572258d, $
              -6355.5838d  , $
              -6356.560715d, $
              -6355.572518d, $
              -6355.572518d, $
              -6355.561236d  ]

      ;;
      ;; Convert angular measures to radians.
      ;;
      lon = lon*cspice_rpd()
      lat = lat*cspice_rpd()

      ;;
      ;; Calculate then output the rectangular coordinates.
      ;;
      cspice_georec,  lon, lat, alt, CLARKR, CLARKF, x

      print, 'Vector:'
      print, FORMAT='( F12.6,3x, F12.6,3x, F12.6)', x

   IDL outputs:
   
      Scalar:
      -2541.748162    4780.333036    3360.428190

      Vector:
          0.000000       0.000000       0.000000
          1.000000       0.000000      -0.000000
          0.000000       1.000000      -0.000000
          0.000000       0.000000       1.000000
         -1.000000       0.000000      -0.000000
          0.000000      -1.000000      -0.000000
          0.000000       0.000000      -1.000000
          1.000000       1.000000       0.000000
          1.000000       0.000000       1.000000
          0.000000       1.000000       1.000000
          1.000000       1.000000       1.000000

Particulars


   None.

Required Reading


   ICY.REQ

Version


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

      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 (JPL)

       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 (JPL)

Index_Entries


   geodetic to rectangular coordinates




Wed Apr  5 17:58:01 2017