<t-let>
A named value computed from other variables. It isn't rendered, but expressions, outputs and formulas can use it like any other variable.
At
Computed values can build on each other: reaction and braking both use
ms. Each is recomputed only when something it reads changes, and at most once per update.
Attributes
| Attribute | Default | Description |
|---|---|---|
name | required | The name of the computed variable. |
expr | required | A JavaScript expression over other variables. |
Why name things?
- Reuse. Write a formula once and refer to it from several outputs, as with
reaction + brakingabove. - Formulas.
\val{total}reads better than repeating a long expression inside TeX. - JavaScript. A chart can read
scope.get("braking")and stay in sync with the text.
Notes
- A computed value can't be dragged. To show it in a formula, use
\val{name}, not\tangle{name}. - Calling
scope.set("name", value)from JavaScript replaces the computed value with a plain one. - A variable that (indirectly) depends on itself shows up as an error in the outputs that use it.