Actions provide a way to react to events in the calculator, like clicks or clock ticks. Each action is made up of one or more update rules, which specify new values for a variable based on specific events within the expression list or on the graph paper.
To learn how to enable Actions on your account and explore the available features, read the resources below.
Enabling Actions
Actions are an advanced feature that must be enabled at the account level.
Make sure you sign in to your account in the Graphing Calculator, Geometry Tool, or 3D Calculator.
Click on your name in the top right to bring up account options and click Account Settings.
Go to the Advanced tab and check the Actions checkbox.
Getting Started With Actions
To author an action, use the right arrow symbol (→). You can create this symbol by typing the subtraction symbol (-) followed by a greater than sign (>).
When writing an action in the expression list, make sure you enable the slider for the included variable if it wasn’t previously defined.
The expression containing the action will then display an action icon. Clicking this icon will run the action each time on click.
Clickable Objects
When actions are enabled, you can attach them to graphed objects like points, curves, and images. The action will run when the object is clicked on the graph paper or within the 3D cube.
Long press the icon to the left of your expression to open the options menu.
Toggle Clickable to the “on” position.
In the field titled On Click, you can author an action that will be performed when the object is clicked in the graph itself.
Clickable Objects Examples
In this example, the compound inequality \(0 \le y \le k−x^2\) is clickable. Each click anywhere within the inequality will increment the variable \(k\) by one.
In this example, directed angles on click rotate the geometric shape 90 degrees clockwise or counterclockwise.
The Ticker
When actions are enabled, you can specify an action that will run repeatedly at a specified interval using the ticker.
To add a ticker, click the Add Item button in the top left of the expression panel of the graphing calculator. You can also type ticker into an expression line.
In the Run section, specify an action.
Optionally, you can set the duration in milliseconds (ms) for the time interval between ticks.
Actions using Variables and Function Notation
Actions can be assigned to variables, such as:
\(A = a\) → 1
This allows you to attach the same action to multiple objects.
Functions can also be used to define actions, such as:
\(f(x) = a\) → \(x\)
This allows you to create related actions. For instance, with this definition, f(1) and f(2) will be distinct actions that set a to 1 and 2 respectively when they run.
Piecewise expressions (using restriction notation in curly brackets) enable you to specify different actions based on a condition.
Curly brackets indicate that a condition is being checked in order to determine which action (if any) to run. In this example, if a is negative (less than \(0\)), then the action will square a. Otherwise (indicated by the comma), a will get subtracted by \(3\).
Actions Tracking Time
Updating a List with Actions
A Random Action
Statistics in Action
Learn More
- Functions
- How do I set up a free account for Desmos Calculator Tools?
- Lists
- Sliders and Movable Points
Please write to us with any questions or feedback to support@desmos.com .