CSPICE_EL2CGV converts a SPICE ellipse to a center vector and two
generating vectors. The selected generating vectors are semiaxes of
the ellipse.
Given:
ellipse a structure describing a SPICE ellipse. The structure has
the fields:
[1,1] = size(ellipse); struct = class(ellipse)
The structure has the fields:
center: [3,1] = size(center); double = class(center)
semiMinor: [3,1] = size(semiMinor); double = class(semiMinor)
semiMajor: [3,1] = size(semiMajor); double = class(semiMajor)
the call:
[center, semiMajor, semiMinor] = cspice_el2cgv( ellipse )
returns:
center the location of the center of 'ellipse'.
[3,1] = size(center); double = class(center)
smajor the semimajor axis of 'ellipse'.
[3,1] = size(smajor); double = class(smajor)
sminor double precision 3x1 array defining the semiminor
axis of 'ellipse'
[3,1] = size(sminor); double = class(sminor)
This ellipse is the set of points
center + cos(theta) smajor + sin(theta) sminor
where theta ranges over the interval (pi, pi].
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 two arbitrary, linearly independent vectors
% and a center vector.
%
vec1 = [ 1; 1; 1 ];
vec2 = [ 1; 1; 1 ];
center = [ 1; 1; 1 ];
%
% Calculate the semimajor and semiminor axes of
% the ellipse as generated by 'vec1' and 'vec2'.
% [The cspice_saelgv call determines the orthogonal axes
% of an ellipse from two generating vectors.]
%
[smajor, sminor ] = cspice_saelgv( vec1, vec2 );
%
% Load the generating vectors into an ellipse structure.
%
[ ellipse ] = cspice_cgv2el( center, smajor, sminor );
%
% Extract the CSPICE_ELLIPSE structure components into
% variable.
%
[ cent, smaj, smin ] = cspice_el2cgv( ellipse )
MATLAB outputs:
cent =
1
1
1
smaj =
1.4142
0.0000
1.4142
smin =
0.0000
1.4142
0.0000
SPICE ellipses serve to simplify calling sequences and reduce
the chance for error in declaring and describing argument lists
involving ellipses.
The set of ellipse conversion routines is
cspice_cgv2el( Center and generating vectors to ellipse )
cspice_el2cgv( Ellipse to center and generating vectors )
A word about the output of this routine: the semimajor axis of
an ellipse is a vector of largest possible magnitude in the set
cos(theta) vec1 + sin(theta) vec2,
where theta is in the interval (pi, pi]. There are two such
vectors; they are additive inverses of each other. The semiminor
axis is an analogous vector of smallest possible magnitude. The
semimajor and semiminor axes are orthogonal to each other. If
smajor and sminor are choices of semimajor and semiminor axes,
then the input ellipse can also be represented as the set of
points
center + cos(theta) smajor + sin(theta) sminor
where theta ranges over the interval (pi, pi].
For important details concerning this module's function, please refer to
the CSPICE routine el2cgv_c.
MICE.REQ
ELLIPSES.REQ
Mice Version 1.0.1, 09NOV2012, EDW (JPL)
Edited I/O section to conform to NAIF standard for Mice documentation.
Mice Version 1.0.0, 30DEC2008, EDW (JPL)
ellipse to center and generating vectors
