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_inedpl

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


Abstract


   CSPICE_INEDPL calculates the intercept of a triaxial ellipsoid
   and a plane.

I/O


   Given:

      a,
      b,
      c        are the scalar double precision lengths of the semi-axes of a
               triaxial ellipsoid.

               help, a
                  DOUBLE = Scalar
               help, b
                  DOUBLE = Scalar
               help, c
                  DOUBLE = Scalar

               The ellipsoid is centered at the origin and oriented so that
               its axes lie on the x, y and z axes. `a', `b', and `c' are the
               lengths of the semi-axes that respectively point in the x, y,
               and z directions.

      plane    a scalar SPICE plane structure that might intersect the
               ellipsoid.

               help, plane
                  STRUCT = CSPICE_PLANE

               The structure has the fields:

                 normal:   [3-array double]
                 constant: [scalar double]

   the call:

      cspice_inedpl, a, b, c, plane, ellips, found

   returns:

      ellips   the scalar SPICE ellipse defining the intersection of `plane'
               and the ellipsoid.

               help, ellips
                  STRUCT = CSPICE_ELLIPSE

               The structure has the fields:

                 center:    [3-array double]
                 semiMajor: [3-array double]
                 semiMinor: [3-array double]

      found    a scalar boolean indicating whether `plane' intersects the
               ellipsoid (true) or not (false).

               help, found
                  BOOLEAN = Scalar

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) Suppose we wish to find the limb of a body, as observed from
      location `loc' in body-fixed coordinates. The Icy routine
      cspice_edlimb solves this problem. Here's how cspice_inedpl is used in
      that solution.

      We assume `loc' is outside of the body. The body is modeled as
      a triaxial ellipsoid with semi-axes of length `a', `b', and `c'.

      The notation

         < x, y >

      indicates the inner product of the vectors `x' and `y'.

      The limb lies on the plane defined by

         < x,  n >  =  1,

      where the vector `n' is defined as

                     2              2              2
         ( loc[0] / a ,   loc[1] / b ,   loc[2] / c  )

      The assignments

         n[0] = loc[0] / (a*a);
         n[1] = loc[1] / (b*b);
         n[2] = loc[2] / (c*c);

      and the calls

         cspice_nvc2pl, n,  1.0,  plane

         cspice_inedpl, a,  b,  c,  plane,  limb, found

         cspice_el2cgv, limb, center, smajor, sminor

      will return the center and semi-axes of the limb.


      How do we know that  < x, n > = 1  for all `x' on the limb?
      This is because all limb points `x' satisfy

         < loc - x, surfnm(x) >  =  0,

      where surfnm(x) is any surface normal at `x'. surfnm(x) is
      parallel to the vector

                        2            2            2
         v = (  x[0] / a ,   x[1] / b ,   x[2] / c   )

      so we have

         < loc - x, v >  =  0,

         < loc, v >      =  < x, v >  =  1  (from the original
                                             ellipsoid
                                             equation)
      and finally

         < x, n >  =  1

      where `n' is as defined above.


   2) We'd like to find the apparent limb of Jupiter, corrected for
      light time and stellar aberration, as seen from JUNO
      spacecraft's position at a given UTC time.

      This example is equivalent to the one in cspice_edlimb, but it uses
      cspice_inedpl to compute the limb.


      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File name: inedpl_ex2.tm

         This meta-kernel is intended to support operation of SPICE
         example programs. The kernels shown here should not be
         assumed to contain adequate or correct versions of data
         required by SPICE-based user applications.

         In order for an application to use this meta-kernel, the
         kernels referenced here must be present in the user's
         current working directory.

         The names and contents of the kernels referenced
         by this meta-kernel are as follows:

            File name                           Contents
            ---------                           --------
            juno_rec_160522_160729_160909.bsp   JUNO s/c ephemeris
            pck00010.tpc                        Planet orientation
                                                and radii
            naif0012.tls                        Leapseconds

         \begindata

            KERNELS_TO_LOAD = ( 'juno_rec_160522_160729_160909.bsp',
                                'pck00010.tpc',
                                'naif0012.tls'  )

         \begintext

         End of meta-kernel


      Example code begins here.


      PRO inedpl_ex2

         ;;
         ;; Local parameters.
         ;;
         UTCSTR = '2016 Jul 14 19:45:00'

         ;;
         ;; Load the required kernels.
         ;;
         cspice_furnsh, 'inedpl_ex2.tm'

         ;;
         ;; Find the viewing point in Jupiter-fixed coordinates. To
         ;; do this, find the apparent position of Jupiter as seen
         ;; from the spacecraft in Jupiter-fixed coordinates and
         ;; negate this vector. In this case we'll use light time
         ;; and stellar aberration corrections to arrive at the
         ;; apparent limb. `jpos' is the Jupiter's position as seen
         ;; from the spacecraft.  `scpos' is the spacecraft's position
         ;; relative to Jupiter.
         ;;
         cspice_str2et, UTCSTR, et
         cspice_spkpos, 'JUPITER', et, 'J2000', 'LT+S', 'JUNO', jpos, ltime

         cspice_vminus, jpos, scpos

         ;;
         ;; Get Jupiter's semi-axis lengths...
         ;;
         cspice_bodvrd, 'JUPITER', 'RADII', 3, rad

         ;;
         ;; ...and the transformation from J2000 to Jupiter
         ;; equator and prime meridian coordinates. Note that we
         ;; use the orientation of Jupiter at the time of
         ;; emission of the light that arrived at the
         ;; spacecraft at time `et'.
         ;;
         cspice_pxform, 'J2000', 'IAU_JUPITER', et-ltime, tipm

         ;;
         ;; Transform the spacecraft's position into Jupiter-
         ;; fixed coordinates.
         ;;
         cspice_mxv, tipm, scpos, scpos

         ;;
         ;; Normalize the position to factors of the radii.
         ;;
         scpos = [ scpos[0]/rad[0]^2, scpos[1]/rad[1]^2, scpos[2]/rad[2]^2 ]
         ;;
         ;; Find the apparent limb.  `limb' is an Icy ellipse
         ;; representing the limb.
         ;;
         cspice_nvc2pl, scpos, 1.0, plane
         cspice_inedpl, rad[0], rad[1], rad[2], plane, limb, found

         ;;
         ;; `center', `smajor', and `sminor' are the limb's center,
         ;; semi-major axis of the limb, and a semi-minor axis
         ;; of the limb.  We obtain these from `limb' using the
         ;; Icy routine cspice_el2cgv ( Ellipse to center and
         ;; generating vectors ).
         ;;
         cspice_el2cgv, limb, center, smajor, sminor

         ;;
         ;; Output the structure components.
         ;;
         print, format='(A)', 'Apparent limb of Jupiter as seen from JUNO:'
         print, format='(2A)', '   UTC time       : ', UTCSTR
         print, format='(A,3F14.6)', '   Semi-minor axis:', sminor[0],       $
                                     sminor[1], sminor[2]
         print, format='(A,3F14.6)', '   Semi-major axis:', smajor[0],       $
                                     smajor[1], smajor[2]
         print, format='(A,3F14.6)', '   Center         :', center[0],       $
                                     center[1], center[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:


      Apparent limb of Jupiter as seen from JUNO:
         UTC time       : 2016 Jul 14 19:45:00
         Semi-minor axis:  12425.547643  -5135.572410  65656.053303
         Semi-major axis:  27305.667297  66066.222576     -0.000000
         Center         :    791.732472   -327.228993   -153.408849


Particulars


   An ellipsoid and a plane can intersect in an ellipse, a single
   point, or the empty set.

Exceptions


   1)  If any of the lengths of the semi-axes of the input ellipsoid
       are non-positive, the error SPICE(DEGENERATECASE) is signaled
       by a routine in the call tree of this routine. `ellips' is not
       modified. `found' is set to False.

   2)  If the input plane in invalid, in other words, if the input
       plane as the zero vector as its normal vector, the error
       SPICE(INVALIDPLANE) is signaled by a routine in the call tree
       of this routine. `ellips' is not modified. `found' is set to
       False.

   3)  If the input plane and ellipsoid are very nearly tangent,
       roundoff error may cause this routine to give unreliable
       results.

   4)  If the input plane and ellipsoid are precisely tangent, the
       intersection is a single point. In this case, the output
       ellipse is degenerate, but `found' will still have the value
       True. You must decide whether this output makes sense for
       your application.

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

   6)  If any of the input arguments, `a', `b', `c' or `plane', is
       not of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

   7)  If any of the output arguments, `ellips' 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
   PLANES.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.1.0, 25-AUG-2021 (JDR)

       Changed the output argument name "ellipse" to "ellips" for
       consistency with other routines.

       Edited the header to comply with NAIF standard. Replaced
       example with mathematical description of the algorithm in
       cspice_edlimb, and added a second complete code example.

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

       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.2, 20-JUN-2011 (EDW)

       Edit to example code, "cspice_unload" replaced with "cspice_kclear,"
       and header.

   -Icy Version 1.0.1, 16-OCT-2006 (EDW)

       Added cspice_unload to example code.

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

Index_Entries


   intersection of ellipsoid and plane



Fri Dec 31 18:43:05 2021