Index Page
saelgv_c
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Procedure
Abstract
Required_Reading
Keywords
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version
Index_Entries

Procedure

   void saelgv_c ( ConstSpiceDouble   vec1  [3],
                   ConstSpiceDouble   vec2  [3],
                   SpiceDouble        smajor[3],
                   SpiceDouble        sminor[3]  ) 

Abstract

 
   Find semi-axis vectors of an ellipse generated by two arbitrary 
   three-dimensional vectors. 
 

Required_Reading

 
   ELLIPSES 
 

Keywords

 
   ELLIPSE 
   GEOMETRY 
   MATH 
 

Brief_I/O

 
   Variable  I/O  Description 
   --------  ---  -------------------------------------------------- 
   vec1, 
   vec2       I   Two vectors used to generate an ellipse. 
   smajor     O   Semi-major axis of ellipse. 
   sminor     O   Semi-minor axis of ellipse. 
 

Detailed_Input

 
   vec1, 
   vec2           are two vectors that define an ellipse. 
                  The ellipse is the set of points in 3-space 
 
                     center  +  cos(theta) vec1  +  sin(theta) vec2 
 
                  where theta is in the interval ( -pi, pi ] and 
                  center is an arbitrary point at which the ellipse 
                  is centered.  An ellipse's semi-axes are 
                  independent of its center, so the vector center 
                  shown above is not an input to this routine. 
 
                  vec2 and vec1 need not be linearly independent; 
                  degenerate input ellipses are allowed. 
 

Detailed_Output

 
   smajor 
   sminor         are semi-major and semi-minor axes of the ellipse, 
                  respectively.  smajor and sminor may overwrite 
                  either of vec1 or vec2. 
 

Parameters

 
   None. 
 

Exceptions

 
   1)  If one or more semi-axes of the ellipse is found to be the 
       zero vector, the input ellipse is degenerate.  This case is 
       not treated as an error; the calling program must determine 
       whether the semi-axes are suitable for the program's intended 
       use. 
 

Files

 
   None. 
 

Particulars

 
   We note here that two linearly independent but not necessarily 
   orthogonal vectors vec1 and vec2 can define an ellipse 
   centered at the origin:  the ellipse is the set of points in 
   3-space 
 
      center  +  cos(theta) vec1  +  sin(theta) vec2 
 
   where theta is in the interval (-pi, pi] and center is an 
   arbitrary point at which the ellipse is centered. 
 
   This routine finds vectors that constitute semi-axes of an 
   ellipse that is defined, except for the location of its center, 
   by vec1 and vec2.  The semi-major axis is a vector of largest 
   possible magnitude in the set 
 
      cos(theta) vec1  +  sin(theta) vec2 
 
   There are two such vectors; they are additive inverses of each 
   other. The semi-minor axis is an analogous vector of smallest 
   possible magnitude.  The semi-major and semi-minor axes are 
   orthogonal to each other.  If smajor and sminor are choices of 
   semi-major and semi-minor axes, then the input ellipse can also 
   be represented as the set of points 
 
      center  +  cos(theta) smajor  +  sin(theta) sminor 
 
   where theta is in the interval (-pi, pi]. 
 
   The capability of finding the axes of an ellipse is useful in 
   finding the image of an ellipse under a linear transformation. 
   Finding this image is useful for determining the orthogonal and 
   gnomonic projections of an ellipse, and also for finding the limb 
   and terminator of an ellipsoidal body. 
 

Examples

 
   1)  An example using inputs that can be readily checked by 
       hand calculation. 
 
          Let 
 
             vec1 = ( 1.,  1.,  1. ) 
             vec2 = ( 1., -1.,  1. ) 
 
         The function call 
 
            saelgv_c ( vec1, vec2, smajor, sminor );
 
         returns 
 
            smajor = ( -1.414213562373095, 
                        0.0, 
                       -1.414213562373095 ) 
         and 
 
            sminor = ( -2.4037033579794549D-17 
                        1.414213562373095, 
                       -2.4037033579794549D-17 ) 
 
 
   2)   This example is taken from the code of the CSPICE routine 
        pjelpl_c, which finds the orthogonal projection of an ellipse 
        onto a plane.  The code listed below is the portion used to 
        find the semi-axes of the projected ellipse. 
 
 
           #include "SpiceUsr.h"
                 .
                 .
                 .
 
           /.
           Project vectors defining axes of ellipse onto plane. 
           ./
           vperp_c ( vec1,   normal,  proj1 ); 
           vperp_c ( vec2,   normal,  proj2 ); 

              . 
              . 
              . 

           saelgv_c ( proj1,  proj2,  smajor,  sminor );
 
 
        The call to saelgv_c determines the required semi-axes. 
 

Restrictions

 
   None. 
 

Literature_References

 
   [1]  Calculus, Vol. II.  Tom Apostol.  John Wiley & Sons, 1969. 
        See Chapter 5, `Eigenvalues of Operators Acting on Euclidean 
        Spaces'. 
 

Author_and_Institution

 
   N.J. Bachman   (JPL) 
   W.L. Taber     (JPL) 
 

Version

 
   -CSPICE Version 1.0.0, 12-JUN-1999 (NJB)

Index_Entries

 
   semi-axes of ellipse from generating vectors 
 

Link to routine saelgv_c source file saelgv_c.c

Wed Apr  5 17:54:42 2017