TI-Nspire CX II reference — guide, TI-Basic, Python and every command

The handheld end to end: the document model, entry and modes, CAS behaviour, TI-Basic, MicroPython, the apps, and the USB link — then 415 commands, symbols, templates and draw commands from TI’s CX CAS Reference Guide. Device facts, the Calculator menu tree and every screen on this page were read off a real CX II CAS running OS 5.4.0.259, not copied from a spec sheet.

415 entries Dotted keys open a submenu or name a key route rather than the Catalog.
Index sectionsProgram Structure & FlowProbability & StatisticsMatrices & VectorsListsStringsCAS: CalculusCAS: Algebra & SolversIntegers & BasesFinanceInput, Output & HardwareNumbers & FunctionsEverything ElseSymbols & OperatorsExpression TemplatesCX II Draw Commands

Guide

how the machine works

The Machine

The TI-Nspire CX II is a 320×240 colour graphing handheld whose whole interface is a document, not a calculator screen. Two variants: CX II (numeric) and CX II CAS (symbolic algebra). Everything below was read off a real CX II CAS over USB, not taken from a spec sheet.

Home ▸ Settings ▸ Status, on the machine these figures came from

Home ▸ Settings ▸ Status, on the machine these figures came from

OSreported as 5.4.0.259
boot1 / boot25.0.0.42 / 5.1.3.110
LCD320 × 240, 16 bpp — 65,536 colours
Storage96,862,208 B total (92.3 MB), 95,969,280 B free out of the box
RAM35,789,856 B as the OS reports it
USBVID 0x0451, PID 0xE022, USB 2.0 high speed
USB interfaceclass 0xFF vendor-specific, subclass 2, two bulk endpoints, 500 mA
Document file.tns
OS image.tcc2 on CAS, .tco2 on non-CAS — the quickest way to tell which machine you have

Telling CAS from non-CAS

The USB product string says only TI-Nspire(tm) CX II Handheld on both models. The CAS-ness shows up in the device-info packet (TI-Nspire CX II CAS), in the OS extension, and on screen in the Home title bar.

Documents, Problems & Pages

Everything you do lives in a three-level container. This is the single idea that makes the Nspire feel unlike every other calculator, and the tab strip along the top is showing it to you at all times.

Document (one .tns file)what you save, send and open└─ Problem 1, 2, 3 …a namespace: variables are shared inside one problem └─ Page 1.1, 1.2, 2.1 …one app each — Calculator, Graphs, Notes …

The tab reads problem.page. So 1.3 is problem 1, page 3. A * before the document name means unsaved.

Page 1.1 — a Calculator page, RAD mode, *Doc unsaved

Page 1.1 — a Calculator page, RAD mode, *Doc unsaved

Why the problem boundary matters

Variables belong to the problem, not the page and not the document. Define a:=5 on page 1.1 and page 1.2 sees it; problem 2 does not. Python shells behave the same way — all shells in one problem share one interpreter state.

Keys

KeyDoes
ctrl Iinsert a page — pick the app
ctrl / previous / next page
ctrl the page sorter
docdocument menu — insert, save, settings
homeout to Home

Scratchpad

The Scratchpad is a document-free calculator for when you just want an answer. It has two halves — Calculate and Graph — and it survives being closed.

Scratchpad ▸ Calculate

Scratchpad ▸ Calculate

KeyDoes
» scratchpadopen it; press again to toggle Calculate / Graph
Home AScratchpad ▸ Calculate
Home BScratchpad ▸ Graph

Scratchpad work is not in any problem, so it cannot see your document variables and they cannot see it. Use Save to Document from its menu to promote the work into a real page.

Entry, Modes & Templates

The Nspire enters maths in two dimensions — fractions stack, integrals get real limits — using templates. Learn the template keys and entry stops being a fight.

Assignment and comparison

a:=5store — this is the assignment operator5→athe same thing, using the sto keya=5an EQUATION, not a store — what solve() wantsDefine f(x)=x^2define a functionf(x):=x^2identical to the above

Template keys

KeysTemplate
ctrl ÷fraction
^exponent
ctrl square root
ctrl ^nth root
t templatesthe full palette — 24 of them, listed in the index

Everything the template palette can build is in the Templates index section below, straight out of TI's reference guide.

Modes that change answers

Set in doc ▸ Settings ▸ Document Settings. The top-right of the screen shows the angle mode at all times — RAD, DEG or GRAD.

ModeEffect
AngleRAD / DEG / GRAD — silently changes every trig result
Calculation ModeAuto, Approximate, or Exact
Real or ComplexReal, Rectangular, Polar
Exponential FormatNormal, Scientific, Engineering

Forcing a decimal

√2in Auto mode returns √2 — exact, not 1.414…ctrl+enterevaluate the current line approximately insteadapprox(√2)same, as a function√2.0a decimal anywhere in the input makes the whole result decimal

Catalog & Where Things Live

Anything not on the menu tree is in the Catalog. Its six tabs are the fastest route to a command whose name you half remember.

The catalog, tab 1 — alphabetical, with the syntax hint at the bottom

The catalog, tab 1 — alphabetical, with the syntax hint at the bottom

TabHolds
1every command, alphabetically
2maths functions and operators
3symbols
4maths templates
5library objects (your MyLib)
6the built-in help

Two things on that screen worth knowing

The bottom strip shows the syntax of whatever is highlighted — abs(Expr) in the capture. Cycle its overloads with the little up/down arrows at the right of the strip.

A snowflake glyph beside an entry means it has a wizard: with Wizards On ticked, picking it opens a fill-in-the-blanks dialog instead of pasting bare syntax. In the capture, ANOVA and ANOVA2way carry it.

Where the reference guide says a command lives

Every entry in TI's reference guide is tagged with how to reach it. Across the 415 parsed entries: 350 say Catalog >, 4 say Hub Menu, and the rest name a key — Ans is ctrl (-), and so on. Those key routes are on the index rows below.

CAS Behaviour

On a CAS handheld an undefined variable is a symbol, not an error. That one rule explains most of what surprises people coming from a numeric calculator.

factor(x^4-1)returns (x−1)·(x+1)·(x²+1) — x need not existsolve(x^2=2,x)returns x=−√2 or x=√2 — both roots, exactlya:=5now a is 5 everywhere in this problem…solve(a^2=2,a)…and this fails, because a is no longer a symbolDelVar amake it a symbol again

Getting a strange result from a symbolic command is almost always a variable you defined earlier in the same problem. DelVar it, or start a new problem.

Exact vs approximate

In the default Auto mode the CAS keeps exact forms until you ask otherwise. √2 stays √2. Press ctrl enter for a decimal, or wrap in approx().

Constraint operator

solve(x^2=4,x) | x>0the | operator constrains — returns x=2 only∫(1/x,x) | x>0give the CAS a domain so it can simplify

What the non-CAS handheld cannot do

solve() symbolically, factor() of an expression, expand(), deSolve(), taylor(), exact surds. It has numeric equivalents — nSolve(), polyRoots() — which work on both machines and are worth preferring when you want a program to be portable.

TI-Basic: Functions & Programs

The Nspire's own language. Two shapes: a function returns a value and may not have side effects; a program has side effects and returns nothing. The editor is at menu ▸ 9 Functions & Programs ▸ 1 Program Editor.

Define f(x)=Funca function — usable inside expressions Local talways declare locals, or you leak into the problem t:=x^2 Return tEndFuncDefine go()=Prgma program — call it on its own line Disp "hello"EndPrgm

Control

If cond Then … ElseIf … Else … EndIfthe full formIf cond: stmtone-line form, colon separatedFor i,1,10,2 … EndForstart, end, optional stepWhile cond … EndWhiletest at the topLoop … EndLoopforever — leave with ExitExit / Cyclebreak / continueLbl a … Goto astill here, still a bad idea

Errors

Try … Else … EndTrythe handler goes after ElseClrErrclear the error and carry onPassErrre-raise it to the caller

Talking to the user

CommandDoes
Dispprint to the calculator history
DispAtprint at a given line
Requestprompt for a value
RequestStrprompt for a string
Texta modal message box
Waitpause for n seconds

Variables, Libraries & Locking

Variables live in the problem. To share code between documents you make a library, which is just a .tns file sitting in the MyLib folder.

Define LibPub area(r)=Funcpublic — shows up in the Catalog's library tabDefine LibPriv helper(x)=Funcprivate — callable, but not listedlibname\funcname(2)call it: library name, backslash, function name

Save the document into MyLib, then doc ▸ Refresh Libraries. On the handheld probed for this sheet, MyLib already held TI's linalgcas.tns and numtheory.tns.

Housekeeping

CommandDoes
DelVardelete a variable — makes it symbolic again
Lock / unLockprotect a variable from being changed
getLockInfo()is it locked?
CopyVarcopy a variable, including across problems
libShortcut()make short local names for a library's objects
ClearAZclear every one-letter variable a–z

Python on the CX II

The CX II ships MicroPython — TI's own words. It is not CPython, and the gap bites in ways that cost an evening if nobody warns you. Add a page with menu ▸ Add Python ▸ New / Shell.

f-strings do not exist

print("b=",b)the comma inserts one spaceprint("b={}".format(b)).format() is the documented methodprint("b=" + str(b))concatenation, when you want no space at all

MicroPython only gained f-strings in 1.17, well after the build TI shipped. TI's own guidebook uses comma-separated print() in every one of its examples and lists .format() as the string-formatting method.

Running a program is an import

What ctrl+R actually does

What ctrl+R actually does

>>>#Running gcc1.pythe shell echoes this…>>>from gcc1 import *…and then does THIS — it imports, it does not execb= 7your output>>>and your names are now in the shell namespace

Consequences worth holding on to: every shell page in one problem shares one interpreter state; your module's names leak into the shell; and re-running after an edit can surprise you. Tools ▸ Reinitialize Shell resets all shells in the problem.

Keys

KeysDoes
ctrl Rcheck syntax, save, run in a Python Shell
ctrl Bcheck syntax and save, without running
ctrl R (in the Shell)rerun the last program

Modules on the handheld

TI ships its modules as .tns files in the handheld's /PyLib/ folder — that is how from ti_plotlib import * resolves. The probed machine held ti_hub, ti_image, ti_plotlib, ti_rover and ti_system. Your own module goes there via Tools ▸ Install as Python Module.

The Apps

Eight apps, one per page. Each brings its own menu tree — the tree you photographed on a Calculator page is not the tree you get on a spreadsheet page.

Home — the eight app tiles, in the handheld's dark theme

Home — the eight app tiles, in the handheld's dark theme

AppFor
Calculatorthe command line — CAS, TI-Basic, history
Graphsfunction, parametric, polar, sequence, 3D, scatter
Geometryconstruction and measurement
Lists & Spreadsheetcolumns, formulas, and the bridge to statistics
Data & Statisticsplots from list data
Notesprose with live maths boxes inside it
Vernier DataQuestsensor capture
Pythoneditor and shell
Graphs — f1(x)=(x−3)·(x+2) on the default window

Graphs — f1(x)=(x−3)·(x+2) on the default window

Lists & Spreadsheet

Column headers, formula row, and the B3 cell reference

Column headers, formula row, and the B3 cell reference

Its own menu is 1 Actions, 2 Insert, 3 Data, 4 Statistics, 5 Table. Actions holds Move Column, Resize, Select, Go To (ctrl G) and Recalculate (ctrl R).

Name a column in its header cell and it becomes a list variable visible to the whole problem — that is how spreadsheet data reaches OneVar, a scatter plot or Python's recall_list().

Calculator Menu Tree

the menu key on a Calculator page — read off a real CX II CAS on OS 5.4.0.259, because it is in neither guidebook. ▸ opens a further submenu; … opens a dialog. With the menu open, press the digit to jump straight in. The non-CAS handheld differs.

1 Actions

1Define2Recall Definition3Delete Variable4Clear a-z...5Clear History6Insert Comment7Library 8Lock

2 Number

1Convert to Decimal2Approximate to Fraction3Factor4Least Common Multiple5Greatest Common Divisor6Remainder7Fraction Tools 8Number Tools 9Complex Number Tools

3 Algebra

1Solve2Factor3Expand4Zeros5Complete the Square6Numerical Solve7Solve System of Equations 8Polynomial Tools 9Fraction Tools AConvert Expression BTrigonometry CComplex DExtract

4 Calculus

1Derivative2Derivative at a Point...3Integral4Limit5Sum6Product7Function Minimum8Function Maximum9Tangent LineANormal LineBArc LengthCSeries DDifferential Equation Solver...EImplicit DifferentiationFNumerical Calculations

5 Probability

1Factorial (!)2Permutations3Combinations4Random 5Distributions

6 Statistics

1Stat Calculations 2Stat Results3List Math 4List Operations 5Distributions 6Confidence Intervals 7Stat Tests

7 Matrix & Vector

1Create 2Transpose3Determinant4Row-Echelon Form5Reduced Row-Echelon Form6Simultaneous7Norms 8Dimensions 9Row Operations AElement Operations BAdvanced CVector

8 Finance

1Finance Solver...2TVM Functions 3Amortization 4Cash Flows 5Interest Conversion 6Days between Dates

9 Functions & Programs

1Program Editor 2Func...EndFunc3Prgm...EndPrgm4Local5Control 6Transfer 7I/O 8Mode 9Add New Line

Python Menu Map

all 299 items of the 14 menus in the Python editor and shell, from TI’s Python Programming Guidebook. The first row of a module menu is the import line it pastes; hover any row for the full description.

Actions

NewOpens the New dialog box where you enter a name and select a type for your ne…
OpenOpens a list of programs available in the current document.
Create CopyOpens the Create Copy dialog box where you can save the current program under…
RenameOpens the Rename dialog box where you can rename the current program.
CloseCloses the current program.
SettingsOpens the Settings dialog box where you can change the font size for both the…
Install as PythonChecks the Python syntax of the current TNS file and moves it to
modulethe PyLib folder.

Run

Run Ctrl+RChecks syntax, saves program, and executes in a Python Shell.
Check Syntax & Save Ctrl+BChecks syntax and saves program.
Go to ShellShifts focus to the Shell related to the current program or opens a new Shell…

Tools

Rerun Last Program Ctrl+RReruns the last program related to the current Shell.
Go to Python EditorOpens the Editor page related to the current Shell.
RunOpens a list of programs available in the current document. After selection,…
Clear HistoryClears the history in the current Shell but does not reinitialize the Shell.
Reinitialize ShellResets the state of all open Shell pages in the current problem. All defined…
dir()Displays list of functions in the specified module when used after the import…
From PROGRAM import *Opens a list of programs available in the current document. After selection,…
Install as Python ModuleEnabled only for modules in binary format. Moves the current TNS file to the…

Edit

IndentTAB* Indents text on the current line or selected lines. * If there are incom…
DedentShift+TAB** Dedents text on the current line or selected lines. ** If there a…
Comment/Uncomment Ctrl+TAdds/removes comment symbol to/from the beginning of the current line.
Insert Multi-line String(Editor only) Inserts multi-line string template.
Find Ctrl+F(Editor only) Opens Find dialog box and searches for the entered string in th…
Replace Ctrl+H(Editor only) Opens Replace dialog box and searches for the entered string in…
Go to Line Ctrl+G(Editor only) Opens Go to Line dialog box and jumps to the specified line in…
Beginning of Line Ctrl+8Moves cursor to the beginning of the current line.
End of Line Ctrl+2Moves cursor to the end of the current line.
Jump to Top Ctrl+7Moves cursor to the beginning of the first line in the program.
Jump to Bottom Built-ins Menu Functions Ctrl+1Moves cursor to the end of the last line in the program.
def function():Defines a function dependent on specified variables.
return ControlDefines the value produced by a function.
if..Conditional statement.
if..else..Conditional statement.
if..elif..else..Conditional statement.
for index in range(size):Iterates over a range.
for index in range(start,stop):Iterates over a range.
for index in range(start,stop,step):Iterates over a range.
for index in list:Iterates over list elements.
while..Executes statements in a code block until a condition evaluates to False.
elif:Conditional statement.
else: OpsConditional statement.
x=ySets variable value.
x==yPastes equal to (==) comparison operator.
x!=yPastes not equal to (!=) comparison operator.
x>yPastes greater than (>) comparison operator.
x>=yPastes greater than or equal to (>=) comparison operator.
x<yPastes less than (<) comparison operator.
x<=yPastes less than or equal to (<=) comparison operator.
andPastes and (and) logical operator.
orPastes or (or) logical operator.
notPastes not (not) logical operator.
TruePastes True Boolean value.
False ListsPastes False Boolean value.
[]Pastes brackets ([]).
list()Converts sequence into "list" type.
len()Returns number of elements of the list.
max()Returns maximum value in the list.
min()Returns minimum value in the list.
.append()The method appends an element to a list.
.remove()The method removes the first instance of an element from a list.
range(start,stop,step)Returns a set of numbers.
for index in range(start,stop,step)Used to iterate over a range.
.insert()The method adds an element at the specified position.
.split()The method returns a list with elements separated by specified delimiter.
sum()Returns sum of the elements of a list.
sorted()Returns a sorted list.
.sort() TypeThe method sorts a list in place.
int()Returns an integer part.
float()Returns a float value.
round(x,ndigits)Returns a floating point number rounded to the specified number of digits.
str()Returns a string.
complex()Returns a complex number.
type() I/OReturns the type of the object.
print()Displays argument as string.
input()Prompts user for input.
eval()Evaluates an expression represented as a string.
.format()The method formats the specified string.

Math

from math import *Imports all methods (functions) from the math module.
fabs()Returns absolute value of a real number.
sqrt()Returns square root of a real number.
exp()Returns e**x.
pow(x,y)Returns x raised to the power y.
log(x,base)Returns logbase(x). log(x) with no base returns the natural logarithm x.
fmod(x,y)Returns module value of x and y. Use when x and y are floats.
ceil()Returns the smallest integer greater than or equal to a real number.
floor()Returns the largest integer less than or equal to a real number.
trunc()Truncates a real number to an integer.
frexp() ConstReturns a pair (y,n) where x == y * 2**n.
eReturns value for the constant e.
pi TrigReturns value for the constant pi.
radians()Converts angle in degrees to radians.
degrees()Converts angle in radians to degrees.
sin()Returns sine of argument in radians.
cos()Returns cosine of argument in radians.
tan()Returns tangent of argument in radians.
asin()Returns arc sine of argument in radians.
acos()Returns arc cosine of argument in radians.
atan()Returns arc tangent of argument in radians.
atan2(y,x)Returns arc tangent of y/x in radians.

Random

from random import *Imports all methods from the random module.
random()Returns a floating point number from 0 to 1.0.
uniform(min,max)Returns a random number x (float) such that min <= x <= max.
randint(min,max)Returns a random integer between min and max.
choice(sequence)Returns a random element from a non-empty sequence.
randrange(start,stop,step)Returns a random number from start to stop by step.
seed()Initializes random number generator.

TI PlotLib

import ti_plotlib as plt SetupImports all methods (functions) from the ti_plotlib module in the "plt" names…
cls()Clears the plotting canvas.
grid(x-scale,y-scale,"style")Displays a grid using specified scale for x and y axes.
window(xmin,xmax,ymin,ymax)Defines the plotting window by mapping the the specified horizontal interval…
auto_window(x-list,y-list)Autoscales the plotting window to fit the data ranges within x-list and y-lis…
axes("mode")Displays axes on specified window in the plotting area.
labels("x-label","y-label",x,y)Displays "x-label" and "y-label" labels on the plot axes at row positions x a…
title("title")Displays "title" centered on top line of window.
show_plot()Displays the buffered drawing output. The use_buffer() and show_plot() functi…
use_buffer() DrawEnables an off-screen buffer to speed up drawing.
color(red,green,blue)Sets the color for all following graphics/plotting.
cls()Clears the plotting canvas.
show_plot()Executes the display of the plot as set up in the program.
scatter(x-list,y-list,"mark")Plots a sequence of ordered pair from (x-list,y-list) with the specified mark…
plot(x-list,y-list,"mark")Plots a line using ordered pairs from specified x-list and y-list.
plot(x,y,"mark")Plots a point using coordinates x and y with the specified mark style.
line(x1,y1,x2,y2,"mode")Plots a line segment from (x1,y1) to (x2,y2).
lin_reg(x-list,y-list,"display")Calculates and draws the linear regression model, ax+b, of x-list,y-list.
pen("size","style")Sets the appearance of all following lines until the next pen() is executed.
text_at(row,"text","align") PropertiesDisplays "text" in plotting area at specified "align".
xminSpecified variable for window arguments defined as plt.xmin.
xmaxSpecified variable for window arguments defined as plt.xmax.
yminSpecified variable for window arguments defined as plt.ymin.
ymaxSpecified variable for window arguments defined as plt.ymax.
mAfter plt.linreg() is executed in a program, the computed values of slope, m,…
bAfter plt.linreg() is executed in a program, the computed values of slope, a,…

TI Hub

from ti_hub import * Hub Built-in Devices > Color OutputImports all methods from the ti_hub module.
rgb(red,green,blue)Sets the color for the RGB LED.
blink(frequency,time)Sets the blinking frequency and duration for the selected color.
off() Hub Built-in Devices > Light OutputTurns the RGB LED off.
on()Turns the LED on.
off()Turns the LED off.
blink(frequency,time) Hub Built-in Devices > Sound OutputSets the blinking frequency and duration for the LED.
tone(frequency,time)Plays a tone of the specified frequency for the specified time.
note("note",time)Plays the specified note for the specified time. The note is specified using…
tone(frequency,time,tempo)Plays a tone of the specified frequency for the specified time and tempo. The…
note("note",time,tempo) Hub Built-in Devices > Brightness InputPlays the specified note for the specified time and tempo. The note is specif…
measurement()Reads the built-in BRIGHTNESS (light level) sensor and returns a reading. The…
range(min,max) Add Input Device This menu has a list of the sensors (input devices) supported by the ti_hub module. All the menu items will paste the name of the object and expect a variable and a port used with the sensor. Each sensor has a measurement() method that returns the value of the sensor.Sets the range for mapping the readings from the light level sensor. If both…
DHT (Digital Humidity & Temp)Returns a list consisting of the current temperature, humidity, type of senso…
RangerReturns the current distance measurement from the specified ultrasonic ranger…
Light LevelReturns the brightness level from the external light level (brightness) senso…
TemperatureReturns the temperature reading from the external temperature sensor. The def…
MoistureReturns the moisture sensor reading.
MagneticDetects the presence of a magnetic field. The threshold value to determine th…
VernierReads the value from the Vernier analog sensor specified in the command. The…
Analog InSupports the use of analog input generic devices.
Digital InReturns the current state of the digital pin connected to the DIGITAL object,…
Potentiometer () function. Thermistor Reads thermistor sensors. The default coefficients are designed to match the thermistor included in the Breadboard Pack of the TI-Innovator™ Hub, when used with a 10KΩ fixed resistor. A new set of calibration coefficients and reference resistance for the thermistor can be configured using the calibrate() function. Loudness Supports sound loudness sensors. Color Input Provides interfaces to an I2C-connected Color Input sensor. The bb_port pin is used in addition to the I2C port to control the LED on the color sensor. • color_number(): Returns a value from 1 to 9 that represents the color the sensor is detecting. The numbers represent the colors per the following mapping: 1: Red 2: Green 3: Blue 4: Cyan 5: Magenta 6: Yellow 7: Black 8: White 9: Gray • red(): Returns a value from 0 to 255 that represents the intensity of the RED color level being detected. • green(): Returns a value from 0 to 255 that represents the intensity of the GREEN color level being detected. • blue(): Returns a value from 0 to 255 that represents the intensity of the BLUE color level being detected. • gray(): Returns a value from 0 to 255 that represents the gray level being detected, where 0 is black and 255 is white. BB Port Provides support for using all 10 BB port pins as aSupports a potentiometer sensor. The range of the sensor can be changed by th…
Hub TimeProvides access to the internal millisecond timer.
TI-RGB Array Add Output Device This menu has a list of the output devices supported by the ti_hub module. All the menu items will paste the name of the object and expect a variable and a port used with the device.Provides functions for programming the TI-RGB Array. The initialization funct…
LEDFunctions for controlling externally connected LEDs.
RGBSupport for controlling external RGB LEDs.
TI-RGB ArrayProvides functions for programming the TI-RGB Array.
SpeakerFunctions for supporting an external speaker with the TI- Innovator™ Hub. The…
PowerFunctions for controlling external power with the TI-Innovator™ Hub. • set(va…
Continuous ServoFunctions for controlling continuous servo motors. • set_cw(speed,time): The…
Analog OutFunctions for the use of analog input generic devices.
Vibration MotorFunctions for controlling vibration motors. • set(val): Sets the vibration mo…
RelayControls interfaces for controlling relays. • on(): Sets the relay to the ON…
ServoFunctions for controlling servo motors. • set_position(pos): Sets the sweep s…
SquarewaveFunctions for generating a square wave. • set(frequency,duty,time): Sets the…
Digital OutInterfaces for controlling a digital output. • set(val): Sets the digital out…
BB Port CommandsProvides functions for programming the TI-RGB Array. See the details above.
sleep(seconds)Pauses the program for the specified number of seconds. Imported from the 'ti…
text_at(row,"text","align")Displays the specified "text" in the plotting area at specified "align". Part…
cls()Clears the Shell screen for plotting. Part of the ti_plotlib module.
while get_key() != "esc":Runs the commands in the "while" loop until the "esc" key is pressed.
get_key() Ports These are the input and output ports available on the TI-Innovator™ Hub. OUT 1 OUT 2 OUT 3 IN 1 IN 2 IN 3 BB 1 BB 2 BB 3 BB 4 BB 5 BB 6 BB 7 BB 8 BB 9 BB 10 I2CReturns a string representing the key pressed. The '1' key returns "1", 'esc'…

TI Rover

import ti_rover as rv DriveImports all methods (functions) from the ti_rover module in the "rv" namespac…
forward(distance)Moves Rover forward the specified distance in grid units.
backward(distance)Moves Rover backward the specified distance in grid units.
left(angle_degrees)Turns Rover left the specified angle in degrees.
right(angle_degrees)Turns Rover right the specified angle in degrees.
stop()Stops any current movement immediately.
stop_clear()Stops any current movement immediately and clears all pending commands.
resume()Resumes the processing of commands.
stay(time)Rover stays in place for the specified amount of time in seconds (optional).…
to_xy(x,y)Moves Rover to coordinate position (x,y) on virtual grid.
to_polar(r,theta_degrees)Moves Rover to polar coordinate position (r, theta) on virtual grid. The angl…
to_angle(angle,"unit") Drive > Drive with OptionsSpins Rover to the specified angle in the virtual grid. The angle is relative…
forward_time(time)Moves Rover forward for the specified time.
backward_time(time)Moves Rover backward for the specified time.
forward(distance,"unit")Moves Rover forward at the default speed for the specified distance. The dist…
backward(distance,"unit")Moves Rover backward at the default speed for the specified distance. The dis…
left(angle,"unit")Turns Rover left the specified angle. The angle can be in degrees, radians, o…
right(angle,"unit")Turns Rover right the specified angle. The angle can be in degrees, radians,…
forward_time(time,speed,"rate")Moves Rover forward for the specified time at the specified speed. The speed…
backward_time(time,speed,"rate")Moves Rover backward for the specified time at the specified speed. The speed…
forward(distance,"unit",speed,"rate")Moves Rover forward for the specified distance at the specified speed. The di…
backward(distance,"unit",speed,"rate") InputsMoves Rover backward for the specified distance at the specified speed. The d…
ranger_measurement()Reads the ultrasonic distance sensor on the front of the Rover, returning the…
color_measurement()Returns a value from 1 to 9, indicating the predominant color being "seen" by…
red_measurement()Returns a value between 0 and 255 that indicates the perceived red level bein…
green_measurement()Returns a value between 0 and 255 that indicates the perceived green level be…
blue_measurement()Returns a value between 0 and 255 that indicates the perceived blue level bei…
gray_measurement()Returns a value between 0 and 255 that indicates the perceived gray level bei…
encoders_gyro_measurement()Returns a list of values that contains the left and right wheel encoder count…
gyro_measurement()Returns a value that represents the current gyro reading, including drift, in…
ranger_time() OutputsReturns the time that the ultrasonic signal from the TI-Rover ranger takes to…
color_rgb(r,g,b)Sets the color of the Rover RGB LED to the specific red, green, blue values.
color_blink(frequency,time)Sets the blinking frequency and duration for the selected color.
color_off()Turns the Rover RGB LED off.
motor_left(speed,time)Sets the left motor power to the specified value for the specified duration.…
motor_right(speed,time)Sets the left motor power to the specified value for the specified duration.…
motors("ldir",left_val,"rdir",right_val,time) PathSets the left and right wheel to the specified speed levels, for an optional…
waypoint_xythdrn()Reads the x-coord, y-coord, time, heading, distance traveled, number of wheel…
waypoint_prevReads the x-coord, y-coord, time, heading, distance traveled, number of wheel…
waypoint_etaReturns the estimated time to drive to a waypoint.
path_done()Returns a value of 0 or 1 depending on whether the Rover is moving (0) or fin…
pathlist_x()Returns a list of X values from the beginning to and including the current Wa…
pathlist_y()Returns a list of Y values from the beginning to and including the current Wa…
pathlist_time()Returns a list of the time in seconds from the beginning to and including the…
pathlist_heading()Returns a list of the headings from the beginning to and including the curren…
pathlist_distance()Returns a list of the distances traveled from the beginning to and including…
pathlist_revs()Returns a list of the number of revolutions traveled from the beginning to an…
pathlist_cmdnum()Returns a list of command numbers for the path.
waypoint_x()Returns x coordinate of current waypoint.
waypoint_y()Returns y coordinate of current waypoint.
waypoint_time()Returns time spent traveling from previous to current waypoint.
waypoint_heading()Returns absolute heading of current waypoint.
waypoint_distance()Returns distance traveled between previous and current waypoint.
waypoint_revs() SettingsReturns number of revolutions needed to travel between previous and current w…
units/sOption for speed in grid units per second.
m/sOption for speed in meters per second.
revs/sOption for speed in wheel revolutions per second.
unitsOption for distance in grid units.
mOption for distance in meters.
revsOption for distance in wheel revolutions.
degreesOption for turning in degrees.
radiansOption for turning in radians.
gradiansOption for turning in gradians.
clockwiseOption for specifying wheel direction.
counter-clockwise Commands These commands are collection of functions from other modules as well as from the TI Rover module.Option for specifying wheel direction.
sleep(seconds)Pauses the program for the specified number of seconds. Imported from the tim…
text_at(row,"text","align")Displays "text" in plotting area at specified "align". Imported from the ti_p…
cls()Clears the Shell screen for plotting. Imported from the ti_plotlib module.
while get_key() != "esc":Runs the commands in the "while" loop until the "esc" key is pressed.
wait_until_done()Pauses the program until the Rover finishes the current command. This is a he…
while not path_done()Runs the commands in the "while" loop until the Rover is finished with all mo…
position(x,y)Sets the Rover position on the virtual grid to the specified x,y coordinate.
position(x,y,heading,"unit")Sets the Rover position on the virtual grid to the specified x,y coordinate,…
grid_origin()Sets RV as being at current grid origin point of (0,0).
grid_m_unit(scale_value)Sets the virtual grid spacing in meters per unit (m/unit) to the value specif…
path_clear()Clears any pre-existing path or waypoint information.
zero_gyro()Resets the Rover gyro to 0.0 angle and clears the left and right wheel encode…

Complex Math

from cmath import *Imports all methods from the cmath module.
complex(real,imag)Returns a complex number.
rect(modulus,argument)Converts polar coordinates to rectangular form of a complex number.
.realReturns real part of the complex number.
.imagReturns imaginary part of a complex number.
polar()Converts rectangular form to polar coordinates of a complex number.
phase()Returns phase of a complex number.
exp()Returns e**x.
cos()Returns cosine of a complex number.
sin()Returns sine of a complex number.
log()Returns natural logarithm of a complex number.
log10()Returns base 10 logarithm of a complex number.
sqrt()Returns square root of a complex number.

Time

from time import *Imports all methods from the time module.
sleep(seconds)Pauses the program for the specified number of seconds.
clock()Returns the current processor time as a floating number expressed in seconds.
localtime()Converts a time expressed in seconds since January 1, 2000 into a nine-tuple…
ticks_cpu()Returns a processor specific increasing millisecond counter with arbitrary re…
ticks_diff()Measures period between consecutive calls to ticks_cpu() or ticks_ms(). This…

TI System

from ti_system import *Imports all methods (functions) from the ti_system module.
recall_value("name")Recalls a predefined OS variable (value) named "name".
store_value("name",value)Stores a Python variable (value) to an OS variable named "name".
recall_list("name")Recalls a predefined OS list named "name".
store_list("name",list)Stores a Python list (list) to an OS list variable named "name".
eval_function("name",value)Evaluates a predefined OS function at the specified value.
get_platform()Returns "hh" for handheld and "dt" for desktop.
get_key()Returns a string representing the key pressed. The '1' key returns "1", 'esc'…
get_mouse()Returns mouse coordinates as a two element tuple, either the canvas pixel pos…
while get_key() != "esc":Run the commands in the "while" loop until the "esc" key is pressed.
clear_history()Clears the Shell history.
get_time_ms()Returns time in milliseconds with millisecond precision. This functionality c…

TI Draw

from ti_draw import * ShapeImports all methods from the ti_draw module.
draw_line()Draws a line starting from the specified x1,y1 coordinate to x2,y2.
draw_rect()Draws a rectangle starting at the specified x,y coordinate with the specified…
fill_rect()Draws a rectangle starting at the specified x,y coordinate with the specified…
draw_circle()Draws a circle starting at the specified x,y center coordinate with the speci…
fill_circle()Draws a circle starting at the specified x,y center coordinate with the speci…
draw_text()Draws a text string starting at the specified x,y coordinate.
draw_arc()Draws an arc starting at the specified x,y coordinate with the specified widt…
fill_arc()Draws an arc starting at the specified x,y coordinate with the specified widt…
draw_poly()Draws a polygon using the specified x-list,y-list values.
fill_poly()Draws a polygon using the specified x-list,y-list values filled with the spec…
plot_xy() Control clear() Clears the entire screen. Can be used with x,y,width,height clear_rect() Clears the rectangle at the specified x,y coordinate with the set_color() Sets the color of the shape(s) that follow in the program until set_pen() Sets the specified thickness and style of the border when drawing set_window() Sets the size of the window in which any shapes will be drawn. get_screen_dim() Returns the xmax and ymax of the screen dimensions. use_buffer() Enables an off-screen buffer to speed up drawing. paint_buffer() Displays the buffered drawing output. Notes • The default configuration has (0,0) in the top left corner of the screen. The positive x-axis points to the right and the positive y-axis points to the bottom This can be modified by using the set_window() function. • The functions in ti_draw module are only available on the handheld and in handheld view on desktop.Draws a shape using the specified x,y coordinate and specified number from 1-…

Variables

Vars: Current Program(Editor only) Displays a list of global functions and variables defined in th…
Vars: Last Run Program(Shell only) Displays a list of global functions and variables defined in the…
Vars: All(Shell only) Displays a list of global functions and variables from both the…

Index

415 entries from the CX CAS Reference Guide (2021) — hover a row for its syntax

Program Structure & Flow

35
ClearAZClears all single-character variables in the current problem spaceClrErrClears the error status and sets system variable errCode to zeroCopyVarCopyVar Var1., Var2CycleTransfers control immediately to the next iteration of the current loop ( For, While, or Loop)DefineDefine Function(Param1, Param2, ...) = Expression Defines the variable Var or the user- defined function FunctDefine LibPrivDefine LibPriv Function(Param1, Param2, ...) = Expression Define LibPriv Function(Param1, Param2, ...) = Func Define LibPubDefine LibPub Function(Param1, Param2, ...) = Expression Define LibPub Function(Param1, Param2, ...) = Func BlDelVarDeletes the specified variable or variable group from memoryDispDisplays the arguments in the Calculator historyDispAtDefine z()= Prgm For n,1,3 DispAt 1,"N: ",n Disp "Hello" EndFor EndPrgm Line 1: N:2 Line 2: Hello Line 3: HellElseIfIf BooleanExpr1 Then Block1 Block2 ⋮ ElseIf BooleanExprN Then BlockN EndIf ⋮ Note for entering the example: FoExitExits the current For, While, or Loop blockForExecutes the statements in Block iteratively for each value of Var, from Low to High, in increments of StepFuncTemplate for creating a user-defined functiongetLockInfo()Returns the current locked/unlocked state of variable VargetMode()Display Digits 12=Float11, 13=Float12, 14=Fix0, 15=Fix1, 16=Fix2, 17=Fix3, 18=Fix4, 19=Fix5, 20=Fix6, 21=Fix7,GotoTransfers control to the label labelName . labelName must be defined in the same function using a Lbl instructIfAllows for branchingLblDefines a label with the name labelName within a functionlibShortcut()Creates a variable group in the current problem that contains references to all the objects in the specified lLocalDeclares the specified vars as local variablesLockLockVarLoopBlock EndLoop Repeatedly executes the statements in Block . Note that the loop will be executed endlessly, unlPassErrunder the Try command, page 191PrgmTemplate for creating a user-defined programRequestPauses the program and displays a dialog box containing the message promptString and an input box for the userRequestStrProgramming command: Operates RequestStr “Your name:”,name,0 identically to the first syntax of the Request coReturnReturns Expr as the result of the functionsetMode()Valid only within a function or programStopStoreTextPauses the program and displays the character string promptString in a dialog boxTryExecutes block1 unless an error occursunLockunLock VarWaitWait is particularly useful in a program that To wait 1/2 second: needs a brief delay to allow requested data WhileExecutes the statements in Block as long as Condition is true

Probability & Statistics

62
ANOVAPerforms a one-way analysis of variance for comparing the means of two to 20 populationsANOVA2wayComputes a two-way analysis of variance for comparing the means of two to 10 populationsbinomCdf()Computes a cumulative probability for the discrete binomial distribution with n number of trials and probabilibinomPdf()Computes a probability for the discrete binomial distribution with n number of trials and probability p of sucCubicRegComputes the cubic polynomial regression y=a•x3+b•x2+c•x+d on lists X and Y with frequency FreqExpRegComputes the exponential regression y = a• (b) x on lists X and Y with frequency FreqFCdf()Computes the F distribution probability between lowBound and upBound for the specified dfNumer (degrees of freFPdf()Computes the F distribution probability at XVal for the specified dfNumer (degrees of freedom) and dfDenomFTest_2SampPerforms a two-sample F testgeomPdf()Computes a probability at XVal , the number of the trial on which the first success occurs, for the discrete ginvBinom()(CumulativeProb,NumTrials,Prob, number 6 shows up that many times or less, Inverse binomialinvBinomN()She plans to practice until she scores 50 Inverse binomial with respect to N. Given the probability of successinvF()invF(Area,dfNumer,dfDenom) computes the Inverse cumulative F distribution function specified by dfNumer and dfinvNorm()Computes the inverse cumulative normal distribution function for a given Area under the normal distribution cuinvχ2 ()Computes the Inverse cumulative χ 2 (chi- square) probability function specified by degree of freedom, df for LinRegBxComputes the linear regression y = a+b•x on lists X and Y with frequency FreqLinRegMxComputes the linear regression y = m •x+b on lists X and Y with frequency FreqLinRegtIntervalsComputes a level C confidence interval for the slopeLinRegtTestComputes a linear regression on the X and Y lists and a t test on the value of slope β and the correlation coeLnRegComputes the logarithmic regression y = a+b•ln(x) on lists X and Y with frequency FreqLogisticComputes the logistic regression y = (c/ (1+a•e-bx)) on lists X and Y with frequency FreqLogisticDComputes the logistic regression y = (c/ (1+a•e-bx)+d) on lists X and Y with frequency Freq, using a specifiedmean()Returns the mean of the elements in List . Each freqList element counts the number of consecutive occurrences median()Returns the median of the elements in List . Each freqList element counts the number of consecutive occurrenceMedMedComputes the median-median line y = (m •x+b) on lists X and Y with frequency FreqMultRegCalculates multiple linear regression of list Y on lists X1, X2, …, X10MultRegIntervalsComputes a predicted y-value, a level C prediction interval for a single observation, and a level C confidenceMultRegTestsMultiple linear regression test computes a multiple linear regression on the given data and provides the globanInt()If the integrand Expr1 contains no variable other than Var, and if Lower and Upper are constants, positive ∞, normCdf()Computes the normal distribution probability between lowBound and upBound for the specified μ (default=0) and normPdf()Computes the probability density function for the normal distribution at a specified XVal value for the specifpoissCdf()Computes a cumulative probability for the discrete Poisson distribution with specified mean λ. For P(X ≤ upBoupoissPdf()Computes a probability for the discrete Poisson distribution with the specified mean λQuadRegComputes the quadratic polynomial regression y=a•x 2 +b•x+c on lists X and Y with frequency FreqQuartRegComputes the quartic polynomial regression y = a•x4+b•x3+c• x2+d•x+e on lists X and Y with frequency Freqrand()rand() returns a random value between 0 and 1randBin()randBin( n, p) returns a random real number from a specified Binomial distributionrandInt()(lowBound,upBound) randInt (lowBound,upBound randInt ( lowBound,upBound) returns a random integer within the rrandNorm()randNorm( μ, σ) returns a decimal number from the specified normal distributionrandSamp()Returns a list containing a random sample of #Trials trials from List with an option for sample replacement ( RandSeedIf Number = 0, sets the seeds to the factory defaults for the random-number generatorSinRegComputes the sinusoidal regression on lists X and Y. A summary of results is stored in the stat.results variabstDevPop()Returns the population standard deviation of the elements in List . Each freqList element counts the number ofstDevSamp()Returns the sample standard deviation of the elements in List . Each freqList element counts the number of contCdf()Computes the Student-t distribution probability between lowBound and upBound for the specified degrees of freetCollect()Returns an expression in which products and integer powers of sines and cosines are converted to a linear combtIntervalComputes a t confidence intervaltInterval_2SampComputes a two-sample t confidence intervaltPdf()Computes the probability density function (pdf) for the Student-t distribution at a specified x value with spetTestPerforms a hypothesis test for a single unknown population mean μ when the population standard deviation σ is tTest_2SampComputes a two-sample t testvarPop()Returns the population variance of List . Each freqList element counts the number of consecutive occurrences ovarSamp()Returns the sample variance of List . Each freqList element counts the number of consecutive occurrences of thzIntervalComputes a z confidence intervalzInterval_1PropComputes a one-proportion z confidence intervalzInterval_2PropComputes a two-proportion z confidence intervalzInterval_2SampComputes a two-sample z confidence intervalzTestPerforms a z test with frequency freqlist . A summary of results is stored in the stat.results variablezTest_2SampComputes a two-sample z testχ2Cdf()Computes the χ 2 distribution probability between lowBound and upBound for the specified degrees of freedom dfχ2GOFPerforms a test to confirm that sample data is from a population that conforms to a specified distributionχ2Pdf()Computes the probability density function (pdf) for the χ 2 distribution at a specified XVal value for the spe

Matrices & Vectors

47
charPoly()Returns the characteristic polynomial of squareMatrix . The characteristic polynomial of n×n matrix A, denotedcolAugment()Returns a new matrix that is Matrix2 appended to Matrix1colDim()Returns the number of columns contained in Matrix . Note: See also rowDim() colNorm()Returns the maximum of the sums of the absolute values of the elements in the columns in Matrix . Note: UndeficonstructMat()Returns a matrix based on the argumentscorrMat()Computes the correlation matrix for the augmented matrix [List1, List2, ..., List20]cos()Returns the matrix cosine of squareMatrix1cos-1()Returns the matrix inverse cosine of squareMatrix1cosh()Returns the matrix hyperbolic cosine of squareMatrix1cosh-1()Returns the matrix inverse hyperbolic cosine of squareMatrix1crossP()Returns the cross product of List1 and List2 as a list►CylindDisplays the row or column vector in cylindrical form [r,∠ θ, z]det()Returns the determinant of squareMatrix . Optionally, any matrix element is treated as zero if its absolute vadiag()Returns a matrix with the values in the argument list or matrix in its main diagonaldim()Returns the dimension of List . Returns the dimensions of matrix as a two- element list {rows, columns}. RetureigVc()Returns a matrix containing the eigenvectors for a real or complex squareMatrix , where each column in the resgetVarInfo()getVarInfo() returns a matrix of information (variable name, type, library accessibility, and locked/unlocked identity()Returns the identity matrix with a dimension of IntegerifFn()Evaluates the boolean expression BooleanExpr (or each element from BooleanExpr ) and produces a result based olist ►mat()Returns a matrix filled row-by-row with the elements from List . elementsPerRow, if included, specifies the nuLUCalculates the Doolittle LU (lower-upper) decomposition of a real or complex matrixmat ►list()Returns a list filled with the elements in Matrix . The elements are copied from Matrix row by rownewMat()Returns a matrix of zeros with the dimension numRows by numColumns►PolarDisplays vector in polar form [r∠ θ]QRCalculates the Householder QR factorization of a real or complex matrixrandMat()Returns a matrix of integers between -9 and 9 of the specified dimension►RectDisplays Vector in rectangular form [x, y, z]ref()Returns the row echelon form of Matrix1rowAdd()Returns a copy of Matrix1 with row rIndex2 replaced by the sum of rows rIndex1 and rIndex2rowDim()Returns the number of rows in Matrix . Note: See also colDim() , page 26rowNorm()Returns the maximum of the sums of the absolute values of the elements in the rows in Matrix . Note: All matrirowSwap()Returns Matrix1 with rows rIndex1 and rIndex2 exchangedrref()Returns the reduced row echelon form of Matrix1simult()Returns a column vector that contains the solutions to a system of linear equationssin()Returns the matrix sine of squareMatrix1sin-1()Returns the matrix inverse sine of squareMatrix1sinh()Returns the matrix hyperbolic sine of squareMatrix1sinh-1()Returns the matrix inverse hyperbolic sine of squareMatrix1►SphereDisplays the row or column vector in iPad®: Hold enter , and select . spherical form [ρ∠ θ∠ φ]stat.valuesDisplays a matrix of the values calculated for the most recently evaluated statistics function or commandT (transpose)Returns the complex conjugate transpose of Matrix1tan()Returns the matrix tangent of squareMatrix1tan-1()Returns the matrix inverse tangent of squareMatrix1tanh()Returns the matrix hyperbolic tangent of squareMatrix1tanh-1()Returns the matrix inverse hyperbolic tangent of squareMatrix1unitV()Returns either a row- or column-unit vector, depending on the form of Vector1χ22wayComputes a χ 2 test for association on the two-way table of counts in the observed matrix obsMatrix . A summar

Lists

40
augment()Returns a new list that is List2 appended to the end of List1cot()Returns the cotangent of Expr1 or returns a list of the cotangents of all elements in List1coth()Returns the hyperbolic cotangent of Expr1 or returns a list of the hyperbolic cotangents of all elements of Licoth-1()Returns the inverse hyperbolic cotangent of Expr1 or returns a list containing the inverse hyperbolic cotangencot⁻¹()Returns the angle whose cotangent is Expr1 or returns a list containing the inverse cotangents of each elementcountif()Returns the accumulated count of all elements in List that meet the specified Criteriacsc -1()Returns the angle whose cosecant is Expr1 or returns a list containing the inverse cosecants of each element ocsc()Returns the cosecant of Expr1 or returns a list containing the cosecants of all elements In Gradian angle modecsch()Returns the hyperbolic cosecant of Expr1 or returns a list of the hyperbolic cosecants of all elements of Listcsch-1()Returns the inverse hyperbolic cosecant of Expr1 or returns a list containing the inverse hyperbolic cosecantscumulativeSum()Returns a list of the cumulative sums of the elements in List1, starting at element 1cZeros()Returns a list of candidate real and non-real values of Var that make Expr=0delVoid()Returns a list that has the contents of List1 with all empty (void) elements removedeigVl()Returns a list of the eigenvalues of a real or complex squareMatrix . squareMatrix is first balanced with simiexp►list()Examines Expr for equations that are separated by the word “or,” and returns a list containing the right-hand FillReplaces each element in variable matrixVar with ExprFiveNumSummary[,Category ,Include ]] Provides an abbreviated version of the 1- variable statistics on list X. A summary of rfreqTable►list()Returns a list containing the elements from List1 expanded according to the frequencies in freqIntegerList . Tfrequency()Returns a list containing counts of the elements in List1geomCdf()Computes a cumulative geometric probability from lowBound to upBound with the specified probability of successinvt()Computes the inverse cumulative student-t probability function specified by degree of freedom, df for a given mRow()Returns a copy of Matrix1 with each element in row Index of Matrix1 multiplied by ExprmRowAdd()Returns a copy of Matrix1 with each element in row Index2 of Matrix1 replaced with: Expr • row Index1 + row InnCr()Returns a list of combinations based on the corresponding element pairs in the two listsnewList()Returns a list with a dimension of numElementsnPr()Returns a list of permutations based on the corresponding element pairs in the two listspiecewise()Returns definitions for a piecewise function in the form of a listproduct()Returns the product of the elements contained in List . Start and End are optionalsec -1()Returns the angle whose secant is Expr1 or returns a list containing the inverse secants In Gradian angle modesec()Returns the secant of Expr1 or returns a list containing the secants of all elements in List1sech()Returns the hyperbolic secant of Expr1 or returns a list containing the hyperbolic secants of the List1 elemensech-1()Returns the inverse hyperbolic secant of Expr1 or returns a list containing the inverse hyperbolic secants of seq()Increments Var from Low through High by an increment of Step, evaluates Expr, and returns the results as a lisseqGen()Generates a list of terms for sequence depVar(Var)=Expr as follows: Increments independent variable Var from Vseqn()Generates a list of terms for a sequence u ( n)=Expr( u, n) as follows: Increments n from 1 through nMax by 1,sum()Returns the sum of all elements in List . Start and End are optionalsumIf()Returns the accumulated sum of all elements in List that meet the specified Criteriasystem()Returns a system of equations, formatted as a listwarnCodes ()Evaluates expression Expr1, returns the result, and stores the codes of any generated warnings in the StatusVaΔList()Returns a list containing the differences between consecutive elements in List1

Strings

11
char()Returns a character string containing the character numbered Integer from the handheld character setexpr()Returns the character string contained in String as an expression and immediately executes itformat()Returns Expr as a character string based on the format templategetLangInfo()Returns a string that corresponds to the short name of the currently active languageGetStrGet command, except that the retrieved value is always interpreted as a stringgetType()Returns a string that indicates the data type of variable varinString()Returns the character position in string srcString at which the first occurrence of string subString beginsleft()Returns the leftmost Num characters contained in character string sourceStringmid()Returns Count characters from character string sourceString, beginning with character number Start . If Count ord()Returns the numeric code of the first character in character string String, or a list of the first characters string()Simplifies Expr and returns the result as a character string

CAS: Calculus

9
arcLen()Returns the arc length of Expr1 from Start to End with respect to variable VardeSolve()Returns an equation that explicitly or implicitly specifies a general solution to the 1st- or 2nd-order ordinadominantTerm()Returns the dominant term of a power series representation of Expr1 expanded about Point . The dominant term iimpDif()Computes the implicit derivative for equations in which one variable is defined implicitly in terms of anotherlimit() or lim()Returns the limit requestednormalLine()Returns the normal line to the curve represented by Expr1 at the point specified in Var=Point . Make sure thatseries()Returns a generalized truncated power series representation of Expr1 expanded about Point through degree OrdertangentLine()Returns the tangent line to the curve represented by Expr1 at the point specified in Var=Point . Make sure thataylor()Returns the requested Taylor polynomial

CAS: Algebra & Solvers

27
cFactor()cFactor( Expr1) returns Expr1 factored with respect to all of its variables over a common denominatorcomDenom()comDenom( Expr1) returns a reduced ratio of a fully expanded numerator over a fully expanded denominatorcompleteSquare ()Converts a quadratic polynomial expression of the form a•x2+b•x+c into the form a•(x- h) 2+k - or - Converts acPolyRoots()The first syntax, cPolyRoots( Poly ,Var) , returns a list of complex roots of polynomial Poly with respect to cSolve()Returns candidate complex solutions of an equation or inequality for Vareuler ()Uses the Euler method to solve the system with depVar( Var0)=depVar0 on the interval [Var0,VarMax ]expand()expand( Expr1) returns Expr1 expanded with respect to all its variablesfactor()factor( Expr1) returns Expr1 factored with respect to all of its variables over a common denominatorgetDenom()Transforms the argument into an expression having a reduced common denominator, and then returns its denominatgetNum()Transforms the argument into an expression having a reduced common denominator, and then returns its numeratorlinSolve()Returns a list of solutions for the variables Var1, Var2, ... The first argument must evaluate to a system of mod()Returns the first argument modulo the second argument as defined by the identities: mod(x,0) = x mod(x,y) = x nSolve()or error_string nSolve(Equation,Var[=Guess],lowBound) nSolve(Equation,Var or error_string nSolve(Equation,Var[polyCoeffs()Returns a list of the coefficients of polynomial Poly with respect to variable VarpolyDegree()Returns the degree of polynomial expression Poly with respect to variable VarpolyEval()Interprets the first argument as the coefficient of a descending-degree polynomial, and returns the polynomialpolyQuotient()Returns the quotient of polynomial Poly1 divided by polynomial Poly2 with respect to the specified variable VapolyRemainder()Returns the remainder of polynomial Poly1 divided by polynomial Poly2 with respect to the specified variable VpolyRoots()The first syntax, polyRoots( Poly ,Var) , returns a list of real roots of polynomial Poly with respect to varipropFrac()propFrac( rational_number) returns rational_number as the sum of an integer and a fraction having the same sigrandPoly()Returns a polynomial in Var of the specified Orderremain()Returns the remainder of the first argument with respect to the second argument as defined by the identities: rk23 ()Uses the Runge-Kutta method to solve the system with depVar( Var0)=depVar0 on the interval [Var0,VarMax ]root()root( Expr) returns the square root of Exprsolve()Returns candidate real solutions of an equation or an inequality for Varsqrt()Returns the square root of the argumentzeros()Returns a list of candidate real values of Var that make Expr=0

Integers & Bases

11
►Base10Converts Integer1 to a decimal (base 10) number►Base16Converts Integer1 to a hexadecimal number►Base2Converts Integer1 to a binary numbergcd()Returns the greatest common divisor of the two argumentsintDiv()Returns the signed integer part of ( Number1 ÷ Number2)iPart()Returns the integer part of the argumentisPrime()Returns true or false to indicate if number is a whole number ≥ 2 that is evenly divisible only by itself and lcm()Returns the least common multiple of the two argumentspolyGcd()Returns greatest common divisor of the two argumentsrotate()Returns a copy of List1 rotated right or left by #of Rotations elementsshift()Returns a copy of List1 shifted right or left by #ofShifts elements

Finance

12
amortTbl()Amortization function that returns a matrix as an amortization table for a set of TVM argumentsbal()Amortization function that calculates schedule balance after a specified paymentdbd()Returns the number of days between date1 and date2 using the actual-day-count methodeff()Financial function that converts the nominal interest rate nominalRate to an annual effective rate, given CpY irr()Financial function that calculates internal rate of return of an investmentnom()Financial function that converts the annual effective interest rate effectiveRate to a nominal rate, given CpYnpv()Financial function that calculates net present value; the sum of the present values for the cash inflows and otvmFV()Financial function that calculates the future value of moneytvmI()Financial function that calculates the interest rate per yeartvmN()Financial function that calculates the number of payment periodstvmPmt()Financial function that calculates the amount of each paymenttvmPV()Financial function that calculates the present value

Input, Output & Hardware

4
►expExpr►exp Represents Expr in terms of the natural exponential e . This is a display conversion operatorGetUse Get to Get [promptString,] func (arg1, ...argn) [, statusVar] Programming command: Retrieves a value from RefreshProbeVarsAllows you to access sensor data from all connected sensor probes in your TI-Basic Prgm programSendSends one or more TI-Innovator™ Hub commands to a connected hub

Numbers & Functions

34
abs()Returns the absolute value of the argumentandReturns true or false or a simplified form of the original entryangle()Returns the angle of the argument, interpreting the argument as a complex numberapprox()Returns the evaluation of the argument as an expression containing decimal values, when possible, regardless o►approxFraction()Returns the input as a fraction, using a tolerance of Tol . If Tol is omitted, a tolerance of 5.E-14 is usedapproxRational()Returns the argument as a fraction using a tolerance of Tol . If Tol is omitted, a tolerance of 5.E-14 is usedcentralDiff()Returns the numerical derivative using the central difference quotient formulaconj()Returns the complex conjugate of the argument►DDReturns the decimal equivalent of the argument expressed in degrees►DecimalDisplays the argument in decimal form►DMSInterprets the argument as an angle and displays the equivalent DMS (DDDDDD°MM'SS.ss'') numberdomain()Returns the domain of Expr1 with respect to Vare^()Returns e raised to the Expr1 powerexp()Returns e raised to the Expr1 powerfloor()Returns the greatest integer that is ≤ the argumentfMax()Returns a Boolean expression specifying candidate values of Var that maximize Expr or locate its least upper bfMin()Returns a Boolean expression specifying candidate values of Var that minimize Expr or locate its greatest lowefPart()Returns the fractional part of the argument►GradConverts Expr1 to gradian angle measureimag()Returns the imaginary part of the argumentint()Returns the greatest integer that is less than or equal to the argumentisVoid()Returns true or false to indicate if the argument is a void data typeln()Returns the natural logarithm of the argumentlog()Returns the base-Expr2 logarithm of the first argumentnDerivative()Returns the numerical derivative calculated using auto differentiation methodsnfMax()Returns a candidate numerical value of variable Var where the local maximum of Expr occursnfMin()Returns a candidate numerical value of variable Var where the local minimum of Expr occursorReturns true or false or a simplified form of the original entryPowerRegComputes the power regressiony = (a• (x) b)on lists X and Y with frequency Freq►RadConverts the argument to radian angle measureround()Returns the argument rounded to the specified number of digits after the decimal pointtExpand()Returns an expression in which sines and cosines of integer-multiple angles, angle sums, and angle differencestmpCnv()Converts a temperature value specified by Expr from one unit to anotherΔtmpCnv()Converts a temperature range (the difference between two temperature Note: You can use the Catalog to select v

Everything Else

37
AnsReturns the result of the most recently evaluated expressionavgRC()Returns the forward-difference quotient (average rate of change)►cosExpr ►cos computer keyboard by typing @>coscount()Returns the accumulated count of all elements in the arguments that evaluate to numeric valuesdotP()Returns the “dot” product of two listseval ()Get, GetStr, and Sendexact()Uses Exact mode arithmetic to return, when possible, the rational-number equivalent of the argumentgetKey()Return Space Inaccessible @,!,^, etcinterpolate ()interpolate(xValue , xList , yList , This function does the following: To see the entire result, press 5 and t►lnCauses the input Expr to be converted to an expression containing only natural logs (ln)►logbaseCauses the input Expression to be simplified to an expression using base Expr1max()Returns the maximum of the two argumentsmin()Returns the minimum of the two argumentsmirr()(financeRate ,reinvestRate ,CF0,CFList [,CFFreq]) Financial function that returns the modified internal rate onandReturns the negation of a logical and operation on the two argumentsnorReturns the negation of a logical or operation on the two argumentsnorm()Returns the Frobenius normnotReturns true, false, or a simplified form of the argumentOneVarCalculates 1-variable statistics on up to 20 listsP►Rx()Returns the equivalent x-coordinate of the (r, θ) pairP►Ry()Returns the equivalent y-coordinate of the (r, θ) pairreal()Returns the real part of the argumentright()Returns the rightmost Num elements contained in List1R►Pr()Returns the equivalent r-coordinate of the ( x,y ) pair argumentsR►Pθ()Returns the equivalent θ-coordinate of the ( x,y ) pair argumentssign()Returns 1 if Expr1 is positive►sinExpr►sin computer keyboard by typing @>sinSortASortA Vector1[, Vector2] [, Vector3]... Sorts the elements of the first argument in ascending orderSortDSortD Vector1[,Vector2][,Vector3]... Identical to SortA, except SortD sorts the elements in descending orderstat.resultsDisplays results from a statistics calculationsubMat()Returns the specified submatrix of Matrix1trace()Returns the trace (sum of all the elements on the main diagonal) of squareMatrix TwoVarCalculates the TwoVar statisticswhen()Returns trueResult , falseResult , or unknownResult , depending on whether Condition is true, false, or unknowxorReturns true if BooleanExpr1 is true and BooleanExpr2 is false, or vice versazTest_1Propstat.p0 stat.z stat.PVal statzTest_2PropComputes a two-proportion z test

Symbols & Operators

44
► (convert)Converts an expression from one unit to another! (factorial)Returns the factorial of the argument# (indirection)Creates or refers to the variable xyz . varNameString% (percent)Returns For a list or matrix, returns a list or matrix with each element divided by 100& (append)Returns a text string that is String2 appended to String1' (prime)variable ' variable ' ' Enters a prime symbol in a differential equation+ (add)Returns the sum of the two arguments. - (dot subt.)Matrix1.− Matrix2 returns a matrix that is the difference between each pair of corresponding elements in Matri. •(dot mult.)Matrix1.• Matrix2 returns a matrix that is the product of each pair of corresponding elements in Matrix1 and M. ⁄ (dot divide)Matrix1 . ⁄ Matrix2 returns a matrix that is the quotient of each pair of corresponding elements in Matrix1 an.+ (dot add)Matrix1.+Matrix2 returns a matrix that is the sum of each pair of corresponding elements in Matrix1 and Matrix.^ (dot power)Matrix1.^ Matrix2 returns a matrix where each element in Matrix2 is the exponent for the corresponding element10^()Returns 10 raised to the power of the argument:= (assign)Var := Expr Var := List Var := Matrix Function(Param1,...) := Expr Function(Param1,...) := List Function(Param< (less than)Returns true if Expr1 is determined to be less than Expr2= (equal)Returns true if Expr1 is determined to be equal to Expr2> (greater than)Returns true if Expr1 is determined to be greater than Expr2^ (power)Returns the first argument raised to the power of the second argument^ -1 (reciprocal)Returns the reciprocal of the argument_ (underscore as unit designator)Expr_Unit Designates the units for an Exprd() (derivative)Returns the first derivative of the first argument with respect to variable VarE (scientific notation)Use r if you want to force radians in a function definition regardless of the mode that prevails when the funcx2 (square)Returns the square of the argument| (constraint operator)Expr | BooleanExpr1[and BooleanExpr2]... Expr | BooleanExpr1[ orBooleanExpr2]... The constraint (“|”) symbol s© (comment)© [text ] © processes text as a comment line, allowing you to annotate functions and programs that you create° (degree)This function gives you a way to specify a degree angle while in Gradian or Radian mode°, ', '' (degree/minute/second)Returns dd+( mm/60)+( ss.ss/3600)Π() (prodSeq)Evaluates Expr1 for each value of Var from Low to High, and returns the product of the resultsΣ() (sumSeq)Evaluates Expr1 for each value of Var from Low to High, and returns the sum of the resultsΣInt()Amortization function that calculates the sum of the interest during a specified range of paymentsΣPrn()Amortization function that calculates the sum of the principal during a specified range of payments• (multiply)Returns the product of the two arguments⁄ (divide)Returns the quotient of Expr1 divided by Expr2→ (store)Expr → Var List → Var Matrix → Var Expr → Function(Param1,...) List → Function(Param1,...) Matrix → Function(P⇒ (logical implication)Evaluates the expression not <argument1> or <argument2> and returns true, false, or a simplified form of the e⇔ (logical double implication, XNOR)Returns the negation of an XOR Boolean operation on the two arguments− (negate)Returns the negation of the argument− (subtract)Returns Expr1 minus Expr2√() (square root)Returns the square root of the argument∠ (angle)Returns coordinates as a vector depending on the Vector Format mode setting: rectangular, cylindrical, or sphe∫() (integral)Returns the integral of Expr1 with respect to the variable Var from Lower to Upper≠ (not equal)Returns true if Expr1 is determined to be not equal to Expr2≤ (less or equal)Returns true if Expr1 is determined to be less than or equal to Expr2≥ (greater or equal)Returns true if Expr1 is determined to be greater than or equal to Expr2

Expression Templates

24
Absolute value templateAbsolute value templatedd° mm’ss.ss’’ templateLets you enter angles in dd°mm’ss.ss ’’ format, where dd is the number of decimal degrees, mm is the number ofDefinite integral templateDefinite integral templatee exponent templateNatural exponential e raised to a powerExponent templatethen type the exponentFirst derivative templateThe first derivative template can also be used to calculate first derivative at a pointFraction templateFraction templateIndefinite integral templateIndefinite integral templateLimit templateUse − or ( −) for left hand limitLog templateCalculates log to a specified baseMatrix template (1 x 2)Matrix template (1 x 2)Matrix template (2 x 1)Matrix template (2 x 1)Matrix template (2 x 2)Creates a 2 x 2 matrixMatrix template (m x n)The template appears after you are prompted to specify the number of rows and columnsNth derivative templateThe nth derivative template can be used to calculate the nth derivativeNth root templateNth root templatePiecewise template (2-piece)Lets you create expressions and conditions for a two-piece piecewise functionPiecewise template (N-piece)Prompts for N. piece)Product template (Π)Product template (Π)Second derivative templateThe second derivative template can also be used to calculate second derivative at a pointSquare root template223Sum template (Σ)Sum template (Σ)System of 2 equations templateCreates a system of two equationsSystem of N equations templatePrompts for N. See the example for System of equations template (2-equation)

CX II Draw Commands

18
ClearClears entire screen if no parameters are specifiedDrawArcDraw an arc within the defined bounding rectangle with the provided start and arc anglesDrawCirclex , y : coordinate of center radius: radius of the circle See Also: FillCircleDrawLineDraw a line from x1, y1, x2, y2DrawPolyThe commands have two variants: ylist:={10,20,150,10} DrawPoly xlist,ylist or DrawPoly x1, y1, x2, y2, x3, y3.DrawRectx , y: upper left coordinate of rectangle width, height : width and height of rectangle (rectangle drawn down DrawTextDraws the text in exprOrString at the specified x , y coordinate locationFillArcDraw and fill an arc within the defined bounding rectangle with the provided start and arc anglesFillCircleDraw and fill a circle at the specified center with the specified radiusFillPolyor FillPoly xlist,ylist FillPoly x1, y1, x2, y2, x3, y3...xn, yn Note: The line and color are specified by SetFillRectDraw and fill a rectangle with the top left corner at the coordinate specified by ( x ,y ) Default fill color getPlatform()Returns: “dt” on desktop software applications “hh” on TI-Nspire™ CX handhelds “ios” on TI-Nspire™ CX iPad® apPaintBufferFor n,1,10 Paint graphics buffer to screen x:=randInt(0,300) This command is used in conjunction with UseBuffePlotXYx , y : coordinate to plot shape shape : a number between 1 and 13 specifying the shape 1 - Filled circle 2 - SetColorSets the color for subsequent Draw commandsSetPenSets the pen style for subsequent Draw commandsSetWindowwill set the output window to have xMin, xMax, yMin, yMax a width of 160 and a height of 120 Establishes a logUseBufferDraw to an off screen graphics buffer instead of screen (to increase performance) y:=randInt(0,200) This comma

Worked Programs

medium-sized examples — every command checked against TI’s reference, but not yet run on the handheld

quad(a,b,c)

Quadratic roots, branching on the discriminant

Returns a list of real roots, one root, or a string. Shows Local, the three-way If/ElseIf/Else, and returning different types from one function.

Define quad(a,b,c)=Func©Real roots of a*x^2+b*x+cctrl+K types the © comment markLocal dwithout this, d leaks into the problemd:=b^2-4*a*cIf d<0 Then Return "no real roots"a function may return a stringElseIf d=0 Then Return {-b/(2*a)}a one-element listElse Return {(-b-√(d))/(2*a),(-b+√(d))/(2*a)}EndIfEndFuncquad(1,-1,-6) → {-2,3}try itquad(1,2,1) → {-1}quad(1,0,4) → "no real roots"

newton(ex,v,g)

Newton's method on any expression

Takes the expression, the variable to solve for, and a starting guess. The | operator substitutes a value into an expression, and centralDiff() is a numeric derivative — so this runs on a non-CAS handheld too.

Define newton(ex,v,g)=Func©Root of expression ex in variable v, from guess gLocal x,dx,ix:=gFor i,1,50always cap the iterations dx:=(ex|v=x)/centralDiff(ex,v=x)| substitutes; centralDiff is numeric x:=x-dx If abs(dx)<1.E-12 Then Return xconverged — leave early EndIfEndForReturn xran out of iterations; return best effortEndFuncnewton(x^2-2,x,1) → 1.41421356237newton(cos(x)-x,x,1) → 0.739085133215in RAD mode

simpson(ex,v,a,b,n)

Composite Simpson's rule

Numeric integration with the 1-4-2-4-1 weighting. Shows a For loop that accumulates, mod() for parity and when() as an inline conditional.

Define simpson(ex,v,a,b,n)=Func©Integral of ex over [a,b] with n panels; n must be evenLocal h,s,i,xIf mod(n,2)≠0 Thenctrl+= types ≠ Return "n must be even"EndIfh:=(b-a)/ns:=(ex|v=a)+(ex|v=b)the two end points, weight 1For i,1,n-1 x:=a+i*h s:=s+(ex|v=x)*when(mod(i,2)=1,4,2)odd index → 4, even → 2EndForReturn (h/3)*sEndFuncsimpson(x^2,x,0,3,100) → 9.exact answer is 9simpson(1/x,x,1,2,100) → 0.693147180563ln 2

collatz(n)

The 3n+1 sequence, built as a list

Grows a list inside a While loop with augment(). The classic shape for "keep going until a condition holds, and keep every step".

Define collatz(n)=Func©The 3n+1 sequence from n down to 1Local lst,klst:={n}k:=nWhile k>1 If mod(k,2)=0 Then k:=k/2 Else k:=3*k+1 EndIf lst:=augment(lst,{k})append — augment glues two listsEndWhileReturn lstEndFunccollatz(6) → {6,3,10,5,16,8,4,2,1}dim(collatz(27)) → 112the famously long one

Monte Carlo π

random, a timed loop, and .format

Throws darts at a quarter circle. Note the timing through ti_system and the .format() call — there are no f-strings on this machine.

from random import *
from ti_system import *

def mc_pi(n):
    hits = 0
    t0 = get_time_ms()
    for i in range(n):
        x = random()
        y = random()
        if x*x + y*y <= 1:
            hits += 1
    ms = get_time_ms() - t0
    est = 4.0 * hits / n
    err = abs(est - 3.141592653589793)
    print("n =", n, " pi ~", est)
    print("err {:.5f} in {} ms".format(err, ms))
    return est

mc_pi(2000)

Start at n=2000. The handheld is not fast; 100,000 darts will take a while.

Least squares from spreadsheet data

ti_system + ti_plotlib together

Reads two named columns out of a Lists & Spreadsheet page, plots them, and draws the regression line. This is the bridge that makes Python useful on the Nspire rather than a toy.

import ti_plotlib as plt
from ti_system import *

xs = recall_list("xdata")
ys = recall_list("ydata")

plt.cls()
plt.auto_window(xs, ys)
plt.axes("on")
plt.labels("x", "y", 1, 1)
plt.title("least squares")
plt.color(41, 97, 181)
plt.scatter(xs, ys, "o")
plt.lin_reg(xs, ys, "left")
plt.show_plot()

Name two spreadsheet columns xdata and ydata first — a named column IS a list variable. color(41,97,181) is the handheld's own blue, #2961b5.

Normalise a list, both ways across the bridge

recall_list / store_list

Pulls a list from the OS, rescales it to 0–1, and writes it back where TI-Basic, a spreadsheet column or a plot can pick it up.

from ti_system import *

def normalise(src, dst):
    v = recall_list(src)
    if v is None or len(v) == 0:
        print("no list named", src)
        return
    lo = min(v)
    hi = max(v)
    if hi == lo:
        print("flat data — nothing to scale")
        return
    out = [(x - lo) / (hi - lo) for x in v]
    store_list(dst, out)
    store_value("span", hi - lo)
    print("wrote", dst, " n =", len(out))
    print("range {} .. {}".format(lo, hi))

normalise("xdata", "xnorm")

store_value("span", …) drops a scalar into the problem too, so a Calculator page can read span straight away.

geocam.cloud/cheatsheets/ti-nspire-cx-ii-reference.html