598
Appendix A: System Routines — Graphing
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
gr_CptIndepInc
(continued)
Example:
Given a floating-point independent value and a pointer to the min, max,
and step values for the independent variable, ICvtFtoP returns the
corresponding increment or 0xFFFF if the independent value is out of
range.
WORD ICvtFtoP( BCD16 f, BCD16 *indep_rng )
{ Access_AMS_Global_Variables;
WORD NewInc;
switch (gr_active->graph_mode) {
case GR_FUNC:
return( (WORD) XCvtFtoP(f, gr_active) );
case GR_DE:
case GR_SEQ:
case GR_PAR:
case GR_POL:
if (gr_CptIndepInc(f, indep_rng, &NewInc))
return( NewInc );
case GR_3D:
return ((f - gr_active->rngp[GR_XMIN]) * (gr_active->rngp[GR_XGRID] /
(gr_active->rngp[GR_XMAX] - gr_active->rngp[GR_XMIN])));
}
return 0xFFFF;
}