Texas Instruments TI-89 Developer's Manual page 650

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

608
GrClipLine
(continued)
Example:
This example is the TI-BASIC Line command. It draws a line (coordinates:
L1, L2, L3, L4) on the current graph using attribute newAttr. The source for
the helper routine, GetAttr, is listed in the example for GraphActivate.
GrClipLine is used to clip the given floating point coordinates to the current
graph window.
void cmd_line (EStackIndex L1, EStackIndex L2, EStackIndex L3,
EStackIndex L4, EStackIndex newAttr)
{
Access_AMS_Global_Variables;
BYTE OrigAttr;
BCD16 x1, y1, x2, y2;
if (GraphActivate(TRUE)) {
OrigAttr = WinAttr(gr_active->grwinp, GetAttr(newAttr) );
if (GrClipLine( ForceFloat(L1), ForceFloat(L2),
&x1, &y1, &x2, &y2, gr_active))
WinLine( gr_active->grwinp, MakeWinRect(
XCvtFtoP(x1,gr_active), YCvtFtoP(y1,gr_active),
XCvtFtoP(x2,gr_active), YCvtFtoP(y2,gr_active)));
WinAttr( gr_active->grwinp, OrigAttr );
}
}
TI-89 / TI-92 Plus Developer Guide
Appendix A: System Routines — Graphing
ForceFloat(L3), ForceFloat(L4),
Not for Distribution
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents