SpiceInt wncard_c ( SpiceCell * window )
Return the cardinality (number of intervals) of a double
precision window.
WINDOWS
WINDOWS
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
window I Input window
The function returns the window cardinality of the window.
window a window containing zero or more intervals
'window' must be declared as a double precision SpiceCell.
The function returns the cardinality of (number of intervals in)
the input window.
None.
None.
None.
This function returns the value of card_c(window)/2.
/. Include needed headers. ./
#include <stdio.h>
#include "SpiceUsr.h"
#define WNSIZE 10
int main()
{
SpiceInt i;
SpiceDouble left;
SpiceDouble right;
SPICEDOUBLE_CELL ( window, WNSIZE );
wnvald_c ( WNSIZE, 0, &window );
wninsd_c ( 1.0, 3.0, &window );
wninsd_c ( 7.0, 11.0, &window );
wninsd_c ( 23.0, 27.0, &window );
for ( i=0; i<wncard_c(&window); i++)
{
wnfetd_c( &window, i, &left, &right );
printf("Interval %d [%f, %f]\n", i, left, right );
}
return ( 0 );
}
The code outputs:
Interval 0 [1.000000 , 3.000000]
Interval 1 [7.000000 , 11.000000]
Interval 2 [23.000000, 27.000000]
None.
None.
E.D. Wright (JPL)
-CSPICE Version 1.0.0, 21-AUG-2007 (EDW)
cardinality of a d.p. window
Link to routine wncard_c source file wncard_c.c
|