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_surfpt

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


Abstract


   CSPICE_SURFPT determines the intersection of a line-of-sight vector with
   the surface of an ellipsoid.

I/O


   Given:

      positn   a 3-vector giving the position of an observer with respect to
               the center of an ellipsoid.

               help, positn
                  DOUBLE = Array[3]

               The vector is expressed in a body-fixed reference frame. The
               semi-axes of the ellipsoid are aligned with the X, Y, and Z-axes
               of the body-fixed frame.

      u        a pointing 3-vector emanating from the observer.

               help, u
                  DOUBLE = Array[3]

      a        the length of the semi-axis of the ellipsoid that is parallel to
               the X-axis of the body-fixed reference frame.

               help, a
                  DOUBLE = Scalar

      b        the length of the semi-axis of the ellipsoid that is parallel to
               the Y-axis of the body-fixed reference frame.

               help, b
                  DOUBLE = Scalar

      c        the length of the semi-axis of the ellipsoid that is parallel to
               the Z-axis of the body-fixed reference frame.

               help, c
                  DOUBLE = Scalar

   the call:

      cspice_surfpt, positn, u, a, b, c, point, found

   returns:

      point    the position of the intercept of the input ray, defined by the
               direction vector `u' emanating from `positn', on the surface of
               the input ellipsoid.

               help, point
                  DOUBLE = Array[3]

               If the ray intersects the ellipsoid, `point' will be
               returned with the body-fixed coordinates of the point
               where the ray first meets the ellipsoid. Otherwise,
               `point' will be returned as (0, 0, 0).

      found    a logical flag indicating whether or not the ray from `positn'
               with direction `u' actually intersects the ellipsoid.

               help, found
                  BOOLEAN = Scalar

               If the ray does intersect the ellipsoid, `found' will be
               returned as True. If the ray misses the ellipsoid, `found' will
               be returned as False

Parameters


   None.

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.

   1) Compute the intersection of a line-of-sight vector with
      the surface of an ellipsoid defined by its three radii.

      Example code begins here.


      PRO surfpt_ex1

         ;;
         ;; Define the radii of an ellipsoid.
         ;;
         a  =  1.d
         b  =  2.d
         c  =  3.d

         ;;
         ;; Define a reference point and a view vector
         ;;
         positn = [  2.d, 0.d, 0.d ]
         u      = [ -1.d, 0.d, 0.d ]

         ;;
         ;; Where on the ellipsoid surface (if anywhere) does
         ;; 'u' intersect the ellipsoid if looking from 'positn'.
         ;;
         cspice_surfpt, positn, u, a, b, c, point, found

         if ( found ) then begin
            print, FORMAT='(A,3F8.3)', 'The look vector            : ', u
            print, FORMAT='(A,3F8.3)', 'at position                : ', $
                                                                positn
            print, FORMAT='(A,3F8.3)', 'intersects the ellipsoid at: ', $
                                                                 point
         endif else begin
            print, "Found no interception point on ellipse."
         endelse

      END


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


      The look vector            :   -1.000   0.000   0.000
      at position                :    2.000   0.000   0.000
      intersects the ellipsoid at:    1.000   0.000   0.000


Particulars


   This routine assumes that an ellipsoid having semi-axes of length `a',
   `b' and `c' is given. Moreover, it is assumed that these axes are
   parallel to the X-, Y-, and Z-axes of a coordinate system whose
   origin is the geometric center of the ellipsoid---this is called the
   body-fixed coordinate frame.

Exceptions


   1)  If the input vector is the zero vector, the error
       SPICE(ZEROVECTOR) is signaled by a routine in the call tree of
       this routine.

   2)  If any of the body's axes is zero, the error
       SPICE(BADAXISLENGTH) is signaled by a routine in the call tree
       of this routine.

   3)  If any of the input arguments, `positn', `u', `a', `b' or `c',
       is undefined, an error is signaled by the IDL error handling
       system.

   4)  If any of the input arguments, `positn', `u', `a', `b' or `c',
       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 any of the output arguments, `point' or `found', is not a
       named variable, an error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   ELLIPSES.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.0.1, 01-JUN-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement and reformatted example's output. Improved
       "point" argument description.

       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.0.0, 16-JUN-2003 (EDW)

Index_Entries


   line of sight intercept with body
   point of intersection between ray and ellipsoid
   surface point of intersection of ray and ellipsoid



Fri Dec 31 18:43:08 2021