Table of contents
CSPICE_TWOPI returns the value of the constant 2*pi.
The call:
[twopi] = cspice_twopi
returns:
twopi twice the value of pi (the ratio of a circle's circumference
to its diameter), determined by the acos function.
[1,1] = size(twopi); double = class(twopi)
That is,
twopi = acos ( -1.0 ) * 2.0;
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) The following code example returns the double precision value of
the constant 2*PI and prints it out.
Example code begins here.
function twopi_ex1()
%
% Print the double precision value of 2*Pi
%
fprintf( '2*Pi: %25.22f\n', cspice_twopi )
When this program was executed on a Mac/Intel/Octave6.x/64-bit
platform, the output was:
2*Pi: 6.2831853071795862319959
The first time the function is referenced, the value is computed
as shown above. The value is saved, and returned directly upon
subsequent reference.
Error free.
None.
None.
MICE.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Mice Version 1.1.0, 25-AUG-2021 (EDW) (JDR)
Edited the header to comply with NAIF standard. Added
example's meta-kernel and reformatted example's output.
Added -Parameters, -Particulars, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Eliminated use of "lasterror" in rethrow.
Removed reference to the function's corresponding CSPICE header from
-Required_Reading section.
-Mice Version 1.0.1, 11-JUN-2013 (EDW)
-I/O descriptions edits to conform to Mice documentation format.
-Mice Version 1.0.0, 22-NOV-2005 (EDW)
twice the value of pi
|