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_inelpl

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


Abstract


   CSPICE_INELPL finds the intersection of an ellipse and a plane.

I/O


   Given:

      ellips   a scalar SPICE ellipse structure.

               help, ellips
                  STRUCT = CSPICE_ELLIPSE

               The structure has the fields:

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

      plane    a scalar SPICE plane structure.

               help, plane
                  STRUCT = CSPICE_PLANE

               The intersection of `plane' and `ellips' is sought. The
               structure has the fields:

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

   the call:

      cspice_inelpl, ellips, plane, nxpts, xpt1, xpt2

   returns:

      nxpts   scalar integer number of points of intersection of the geometric
               plane and ellipse represented by `plane' and `ellips'.

               help, nxpts
                  LONG = Scalar

               `nxpts' may take the values 0, 1, 2 or -1. The value -1
               indicates that the ellipse lies in the plane, so the number of
               intersection points is infinite.

              -1 also signals for the degenerate case where the ellipse
              structure defines a single point and that point lies
              in the plane of interest. In this case, -1 means not an
              infinite number of intersections, rather that the
              ellipse is a subset of the plane, that subset having
              measure one.

      xpt1,
      xpt2    double precision 3-vectors points of intersection of the input
               plane and ellipse.

               help, xpt1
                  DOUBLE = Array[3]
               help, xpt2
                  DOUBLE = Array[3]

               If there is only one intersection point, both `xpt1' and `xpt2'
               contain that point. If the number of intersection points is zero
               or infinite, the contents of `xpt1' and `xpt2' are undefined.

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) Find the intersection of an ellipse and a plane for three
      cases: between Saturn's limb as seen from a position in
      Saturn's body frame at one hundred equatorial radii out along
      the x axis, one hundred radii above the equatorial plane
      point and Saturn's equatorial plane; between Saturn's limb
      as seen from a position in Saturn's body frame at one hundred
      radii along the Z pole vector (positive) and Saturn's equatorial
      plane; and between Saturn's limb as seen from a position in
      Saturn's body frame at one radii along the X axis and Saturn's
      equatorial plane.

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

         pck00008.tpc


      Example code begins here.


      PRO inelpl_ex1

         ;;
         ;; Load a PCK.
         ;;
         cspice_furnsh, 'pck00008.tpc'

         ;;
         ;; Retrieve the triaxial radii of Saturn (699)
         ;;
         cspice_bodvrd, 'SATURN', 'RADII', 3, radii

         ;;
         ;; Define a position in the body frame at one hundred equatorial
         ;; radii out along the x axis, one hundred radii above the
         ;; equatorial plane.
         ;;
         vertex = [ 100.d0 * radii[0], 0.d0, radii[0] *100.d0 ];

         ;;
         ;; Find the limb of the ellipsoid as seen from the
         ;; point 'vertex'. 'limb' returns as a CSPICE_ELLIPSE.
         ;;
         cspice_edlimb, radii[0], radii[1], radii[2], vertex, limb

         ;;
         ;; Define the equatorial plane as a SPICE plane. The Z
         ;; axis is normal to the plane, the origin lies in the
         ;; plane.
         ;;
         normal = [ 0.d, 0.d, 1.d]
         point  = [ 0.d, 0.d, 0.d]
         cspice_nvp2pl , normal, point, plane

         ;;
         ;; Calculate the intersection of the 'limb' and
         ;; 'plane'.
         ;;
         cspice_inelpl, limb, plane, nxpts, xpt1, xpt2

         print, FORMAT='(A,I2)', 'Observer at (100, 0, 100) radii, ' +$
                                 'no. intersection points: ',nxpts
         print, '   Intersection points'
         print, xpt1
         print, xpt2
         print, ' '

         ;;
         ;; One hundred radii along the Z pole vector (positive)
         ;;
         vertex = [ 0.d0 * radii[0], 0.d0, radii[0] *100.d0 ];

         ;;
         ;; The resulting limb ellipse should lie parallel to, but
         ;; not in the same plane as the equatorial plane. No
         ;; intersection should exist.
         ;;
         cspice_edlimb, radii[0], radii[1], radii[2], vertex, limb
         cspice_inelpl, limb, plane, nxpts, xpt1, xpt2

         print, FORMAT='(A,I2)', 'Ellipse/plane parallel case, '    +$
                                 'no. intersection points    : ',nxpts
         print, ' '

         ;;
         ;; One radii along the X axis, i.e. on the surface, a very
         ;; degenerate case.
         ;;
         vertex = [ radii[0], 0.d0, 0.d0 ];

         ;;
         ;; In this case the limb ellipse exists as a point at (x, 0, 0).
         ;;
         cspice_edlimb, radii[0], radii[1], radii[2], vertex, limb

         ;;
         ;; Calculate the intersection of the plane and the degenerate
         ;; ellipse.
         ;;
         cspice_inelpl, limb, plane, nxpts, xpt1, xpt2

         ;;
         ;; As the point (x, 0, 0) exists in `plane' and that point represents
         ;; the complete ellipse, the routine should return -1 for infinite
         ;; number of intersections - though in this case the intersection
         ;; contains only one element.
         ;;
         print, FORMAT='(A,I2)', 'Degenerate case, no. intersection ' +$
                                 'points                : ', nxpts

         ;;
         ;; 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:


      Observer at (100, 0, 100) radii, no. intersection points:  2
         Intersection points
             602.68000       60264.987   3.1832315e-12
             602.68000      -60264.987  -9.3791641e-12

      Ellipse/plane parallel case, no. intersection points    :  0

      Degenerate case, no. intersection points                :  1


Particulars


   This routine computes the intersection set of a non-degenerate
   plane with a possibly degenerate ellipse. The ellipse is allowed
   to consist of a line segment or a point.

   A plane may intersect an ellipse in 0, 1, 2, or infinitely many
   points. For there to be an infinite set of intersection points,
   the ellipse must lie in the plane and consist of more than one
   point.

Exceptions


   1)  If the input plane is invalid, the error SPICE(INVALIDPLANE)
       is signaled by a routine in the call tree of this routine. The
       input plane must be a SPICE plane: the normal vector must be
       non-zero and the constant must be non-negative.

   2)  If the input ellipse has non-orthogonal axes, the error
       SPICE(INVALIDELLIPSE) is signaled by a routine in the call
       tree of this routine.

   3)  The input ellipse is allowed to be a line segment or a point;
       these cases are not considered to be errors. If the ellipse
       consists of a single point and lies in the plane, the number
       of intersection points is set to 1 (rather than -1) and
       the output arguments `xpt1' and `xpt2' are assigned the value
       of the ellipse's center.

   4)  If any of the input arguments, `ellips' or `plane', is
       undefined, an error is signaled by the IDL error handling
       system.

   5)  If any of the input arguments, `ellips' 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.

   6)  If any of the output arguments, `nxpts', `xpt1' or `xpt2', 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.0.2, 10-AUG-2021 (JDR)

       Fixed description in -Particulars section.

       Edited the -Examples section to comply with NAIF standard. Added
       example's problem statement and required PCK. Reformatted example's
       output. Replaced "cspice_unload" by "cspice_kclear" in example.

       Added -Parameters, -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.1, 21-JUN-2011 (EDW)

       Edits to comply with NAIF standard for Icy headers. -Particulars
       section now parallels Mice version.

   -Icy Version 1.0.0, 20-OCT-2006 (EDW)

Index_Entries


   intersection of ellipse and plane



Fri Dec 31 18:43:05 2021