Index Page
cspice_latrec
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_LATREC converts latitudinal coordinates to rectangular
   (Cartesian) coordinates.

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

I/O

   
   Given:
   
      radius      a double precision scalar or N-vector describing 
                  the distance of the position from origin.

      longitude   a double precision scalar or N-vector describing 
                  the angle of the position from the XZ plane
                  measured in radians.

      latitude    a double precision scalar or N-vector describing
                  the angle of the position from the XY plane
                  measured in radians
   
   the call:
   
      cspice_latrec, radius, longitude, latitude, 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 'radius', 'longitude', and 'latitude'.

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.

      ;; 
      ;; Define eleven sets of latitude coordinates, 'longitude'
      ;; and 'latitude' expressed in degrees.
      ;;
      radius   = [ 0d, 1d, 1d , 1d , 1d  ,   1d, $
                   1d, 1.4142d, 1.4142d, 1.4142d, 1.732d   ]
                   
      longitude= [ 0d, 0d, 90d, 0d , 180d, -90d, $
                   0d, 45d    , 0d     , 90d    , 45d      ]
                   
      latitude = [ 0d, 0d, 0d , 90d, 0d  ,   0d, $
                 -90d, 0d     , 45d    , 45d    , 35.2643d ]

      lon_rad = longitude * cspice_rpd()
      lat_rad = latitude  * cspice_rpd()

      ;;
      ;; Convert the coordinates from latitudinal to rectangular.
      ;;
      cspice_latrec, radius, lon_rad, lat_rad, rectan

      ;;
      ;; Print a header for the data output.
      ;;
      print, '   radius  longitude  latitude     x          y         z   '
      print, '  --------  --------  --------  --------  --------  --------'

      ;;
      ;; Load the data for easy output.
      ;;
      output      = dblarr( 6, 11 )

      output[0,*] = radius
      output[1,*] = longitude
      output[2,*] = latitude
      output[3,*] = rectan[0,*]
      output[4,*] = rectan[1,*]
      output[5,*] = rectan[2,*]

      ;;
      ;; Output the coordinate table.
      ;;
      print, FORMAT='(6D10.4)', output

   IDL outputs:

       radius  longitude  latitude     x          y         z   
      --------  --------  --------  --------  --------  --------
        0.0000    0.0000    0.0000    0.0000    0.0000    0.0000
        1.0000    0.0000    0.0000    1.0000    0.0000    0.0000
        1.0000   90.0000    0.0000    0.0000    1.0000    0.0000
        1.0000    0.0000   90.0000    0.0000    0.0000    1.0000
        1.0000  180.0000    0.0000   -1.0000    0.0000    0.0000
        1.0000  -90.0000    0.0000    0.0000   -1.0000    0.0000
        1.0000    0.0000  -90.0000    0.0000    0.0000   -1.0000
        1.4142   45.0000    0.0000    1.0000    1.0000    0.0000
        1.4142    0.0000   45.0000    1.0000    0.0000    1.0000
        1.4142   90.0000   45.0000    0.0000    1.0000    1.0000
        1.7320   45.0000   35.2643    1.0000    1.0000    1.0000

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 'radius',
       'longitude', and 'latitude' as input,
       returning array 'rectan' on output.

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

Index_Entries


   latitudinal to rectangular coordinates




Wed Apr  5 17:58:02 2017