Actions and Tickers
Actions and tickers greatly expand what a Desmos graph can do by updating variables and running operations repeatedly.
Actions
Action basics
Define , then enter a->a+1. Desmos converts the arrow and recognizes the expression as an action. Press its action button to increase by one.
Multiple updates
Comma-separated updates run simultaneously. Their right-hand sides use values from before the action runs.
After one run, . One action cannot contain multiple update rules for the same variable.
Assigning actions to variables
Running runs and together. The same no-duplicate-update rule still applies.
Running an action by clicking a graph
Points, curves, and labels can be made clickable and assigned an action.
Click the “increase/decrease by 1” labels to change .
Tickers
A ticker runs an action at a regular interval. Select “ticker” from the Add menu. If it is not listed, create an action first.
Enter an action in the Run field and an interval in milliseconds on the right, then use the metronome button to start it.
Measuring elapsed time with dt
Heavy calculations may prevent a ticker from keeping its requested interval. This example runs every millisecond, but its displayed time drifts from real time.
The special variable contains the elapsed milliseconds since the previous tick. Updating reduces dependence on device performance.
Lists and index
When clicking one of several list-generated objects, the special variable identifies which item was clicked.
Click the green circles to see a different update for each list item.