Appendix A: System Routines — Graphing
589
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
CptDeltay
Declaration:
BYTE
CptDeltay
(GR_WIN_VARS *
ptr
)
Category(ies):
Graphing
Description:
Computes Window variable
∆
y using the viewing window values and
window height in the GR_WIN_VARS struct pointed to by
ptr
and sets the
GR_DIRTY flag (
ptr
->gr_win_flags & GR_DIRTY
) if the newly computed
∆
y is not equal to the old
∆
y.
Inputs:
ptr
— Pointer to the GR_WIN_VARS struct to use for viewing window
values and window height (
gr_active
for the active graph window,
gr_other
for the second graph in two graph mode).
Outputs:
Returns 0 if
∆
y could not be computed due to invalid viewing window
values, otherwise returns 1. If valid, the new
∆
y is stored in
(
ptr
->rngp)[GR_DELTAY]
.
Assumptions:
Assumes the window height in
ptr
->ymaxpix
is correct. If the window size
has been changed since the graph was last displayed,
ptr
->ymaxpix
will
not have been updated, so the new
∆
y will not be correct. In this case,
∆
y
will automatically be recomputed the next time the graph is displayed,
using the correct window height.
Side Effects:
If the GR_DIRTY flag is set, the graph will be redrawn next time it is
displayed.
Availability:
All versions of the TI-89 / TI-92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: CptDeltax
Example:
/* make sure deltax and deltay are correct */
if(gr_active->gr_win_flags & GR_DIRTY)
/* viewing window values may have changed, recompute deltax and deltay */
if ( ! ( CptDeltax(gr_active) && CptDeltay(gr_active) ) )
ER_throw( ER_RANGE ); /* cannot compute valid deltax and deltay */