Table of contents
CSPICE_PSV2PL returns a SPICE plane given a point and two spanning vectors.
Given:
point,
span1,
span2 respectively, a point and two spanning vectors that define a
geometric plane in three-dimensional space.
help, point
DOUBLE = Array[3]
help, span1
DOUBLE = Array[3]
help, span2
DOUBLE = Array[3]
The plane is the set of vectors
point + s * span1 + t * span2
where `s' and `t' are real numbers. The spanning vectors
`span1' and `span2' must be linearly independent, but they
need not be orthogonal or unitized.
the call:
cspice_psv2pl, point, span1, span2, plane
returns:
plane a SPICE plane that represents the geometric plane defined by
`point', `span1', and `span2'.
help, plane
STRUCT = CSPICE_PLANE
The structure has the fields:
plane.normal: [3-array double]
plane.constant: [scalar double]
None.
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) Calculate the inclination of the Moon's orbit plane about
the Earth to the orbit plane of the Earth around the sun.
Perform geometric analysis, so use no aberration correction
for the calculation. Use the Ecliptic J2000 frame
as a conceptual convenience, however the result is invariant
with respect to an inertial frame.
Use the meta-kernel shown below to load the required SPICE
kernels.
KPL/MK
File name: psv2pl_ex1.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
--------- --------
de421.bsp Planetary ephemeris
naif0012.tls Leapseconds
\begindata
KERNELS_TO_LOAD = ( 'de421.bsp',
'naif0012.tls' )
\begintext
End of meta-kernel
Example code begins here.
PRO psv2pl_ex1
epoch = 'Jan 1 2005'
frame = 'ECLIPJ2000'
corr = 'NONE'
;;
;; Load the kernels we need to retrieve state data.
;;
cspice_furnsh, 'psv2pl_ex1.tm'
;;
;; Convert the time string to ephemeris time
;;
cspice_str2et, epoch, et
;;
;; Calculate the orbit plane of the Earth about
;; the solar system barycenter at epoch.
;;
cspice_spkezr, 'EARTH', et, frame, corr, $
'Solar System Barycenter', state, ltime
cspice_psv2pl, state[0:2], state[0:2], state[3:5], es_plane
cspice_pl2nvc, es_plane, es_norm, es_const
;;
;; Calculate the orbit plane of the Moon with respect to
;; the Earth-Moon barycenter at epoch.
;;
cspice_spkezr, 'MOON', et, frame, corr, $
'EARTH BARYCENTER', state, ltime
cspice_psv2pl, state[0:2], state[0:2], state[3:5], em_plane
cspice_pl2nvc, em_plane, em_norm, em_const
;;
;; Calculate the inclination (output in degrees) from
;; the angle between the plane normals.
;;
;; Depending on the orientation of the plane normals, the
;; cspice_vsep result may exceed 90 degrees. If, so subtract
;; the value off 180 degrees.
;;
loc_inc = cspice_vsep( es_norm, em_norm );
if ( loc_inc GT cspice_halfpi() ) then begin
loc_inc = cspice_pi() - loc_inc
endif
print, 'Moon-Earth orbit plane inclination (degrees): ', $
loc_inc * cspice_dpr()
;;
;; 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:
Moon-Earth orbit plane inclination (degrees): 5.0424940
Icy geometry routines that deal with planes use the `plane'
data type to represent input and output planes. This data type
makes the subroutine interfaces simpler and more uniform.
The Icy routines that produce SPICE planes from data that
define a plane are:
cspice_nvc2pl ( Normal vector and constant to plane )
cspice_nvp2pl ( Normal vector and point to plane )
cspice_psv2pl ( Point and spanning vectors to plane )
The Icy routines that convert SPICE planes to data that
define a plane are:
cspice_pl2nvc ( Plane to normal vector and constant )
cspice_pl2nvp ( Plane to normal vector and point )
cspice_pl2psv ( Plane to point and spanning vectors )
Any of these last three routines may be used to convert this
routine's output, 'plane', to another representation of a
geometric plane.
1) If `span1' and `span2' are linearly dependent, i.e. the vectors
`point', `span1', and `span2' do not define a plane, the error
SPICE(DEGENERATECASE) is signaled by a routine in the call
tree of this routine.
2) If any of the input arguments, `point', `span1' or `span2', is
undefined, an error is signaled by the IDL error handling
system.
3) If any of the input arguments, `point', `span1' or `span2', is
not of the expected type, or it does not have the expected
dimensions and size, an error is signaled by the Icy
interface.
4) If the output argument `plane' is not a named variable, an
error is signaled by the Icy interface.
None.
None.
ICY.REQ
PLANES.REQ
[1] G. Thomas and R. Finney, "Calculus and Analytic Geometry,"
7th Edition, Addison Wesley, 1988.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 13-AUG-2021 (JDR)
Edited the header to comply with NAIF standard. Added example's
problem statement and meta-kernel. Added cspice_kclear to code
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, 01-SEP-2010 (EDW)
Improved the -I/O section. The section now meets NAIF standard
for Icy headers. Improved -Particulars section.
Corrected example code to perform described function.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
point and spanning vectors to plane
|