The new TI Nspire CX II and TI Nspire CX II CAS has an expanded library of programming commands. We are now able to draw and place text anywhere on the screen.
When a drawing command is used, the Nspire shifts into graphics mode. The graphics screen is treated as a final output screen. Graphics mode only executes in one of two places:
* Running the program in a Calculator page in a document
* Running the program in the Calculator part of the Sketchpad
When a graphics screen has an initial (and maximum) height of 212 pixels and an initial (and maximum) width of 318 pixels. The default background is white.
Shifting a Program to Graphics Mode
The Nspire shifts into graphics mode automatically any time a drawing command is executed. Followed by their basic syntax, the commands are:
Clear (blank to clear the entire screen), (x, y, width, height)
DrawArc x, y, width, height, startAngle, sweepAngle
DrawCircle x, y, radius
DrawLine x1, y1, x2, y2
DrawPoly (see plotdemo2 for further details)
DrawRect upper_x_pixel, upper_y_pixel, width, height
DrawText x, y, string/text/expression
FillArc x, y, width, height, startAngle, sweepAngle
FillCircle x, y, radius
FillPoly (see plotdemo2 for further details)
FillRect upper_x_pixel, upper_y_pixel, width, height
getPlatform() (returns dt for desktop, hh for handheld, ios for the iOS App)
PaintBuffer (buffers the paint screen)
PlotXY x, y, shape (13 shapes available: 1 for dot, 5 for cross, 6 for plus, 8, for medium dot)
SetColor red, green, blue (sets the Nspire’s color pen)
SetPen thickness, style (1 thin, 2 medium, 3 thick; 1 smooth, 2, dotted, 3 dashed)
SetWidnow xMin, xMax, yMin, yMax (establishes drawing area – use this command to switch coordinates to Cartesian)
UseBuffer (tells the Nspire to use an off screen to draw objects, then use
PaintBuffer to call them back up)
Once graphics mode is entered, the following commands cannot be used:
This means if you want the user to able to input during graphics mode, you will need to use Getkey.
When the Graphics Is Displayed
The graphics will be displayed until the user presses [ enter ].
Caution: The drawing commands are only available for the CX II. The original CX, nor any previous incarnations of the TI Nspire will not have these commands.
TI NSpire CX II Program plotdemo1
This demo shows all the possible shapes that PlotXY has. Colors are set randomly.
:© graphics uses pixels: 318 * 212
:© Plotxy demo
:© set colors
:© draw text and points
TI NSpire CX II Program plotdemo2
This demo draws filled polygons. There are two syntax sets for DrawPoly and FillPoly:
Draw/FillPoly x1, y1, x2, y2, … ,xn, yn
With this format the polygon stops at the coordinate (xn, yn). The polygon is not automatically completed under this format. To complete the polygon, make sure that the coordinate (x1, y1) is the last two coordinates listed.
Draw/FillPoly x_coordinate_list, y_coordinate_list
With this format, the polygon is automatically completed.
:© draw four triangles, filled
:© draw background box – gray
:© use fill, no draw
:© remember: x,y,width,height
:© now the triangles
TI Nspire CX II Program plotdemo3
This demo draws the function y = 1.5 cos (x^2). The angle is set to radians mode. The coordinates are converted to pixels prior to plotting them.
:© draw y=1.5cos(x^((2)))
:© denim color
: DrawText 10,10,xp
: PlotXY xp,yp,1
TI Nspire CX II Program plotdemo5
Like in plotdemo3, this program draws y = 1.5 cos (x^2). Instead of converting coordinates to pixels, SetWindow is used and adjust the coordinates so that Cartesian coordinates can be used.
:© draw y=1.5cos(x^((2)))
:© denim color
:© only x scaling is necesary
:© changes pixels to Cartesian
: PlotXY x,y,1
This is a basic demonstration of drawing with the TI Nspire CX II. On the next post, I show how to use getKey in graphics mode.
All original content copyright, © 2011-2019. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.