Interactive Math

This page focuses on the interactive math features supported by the InteractiveInkCanvas.

Math principles

The InteractiveInkCanvas comes with a IIMathManager which is the Math main manager that orchestrates all math-related sub-managers. Each sub-manager has a dedicated role:

  • The IIMathCapabilitiesSubManager determines which math operations are available for each math block.
  • The IIMathComputationSubManager is responsible for running and tracking math block numerical solver operations.
  • The IIMathVariableSubManager manages variable states and tracks variable dependencies and visual interactions.
  • The IIMathFunctionEvaluationSubManager is responsible for function evaluation i.e getting the list of points resulting from evaluating the given variables in math blocks and using their coordinates to plot graphs.

The next sections focuses on the main math capabilities and examples that will help you customize your integration.

To benefit from math features, InteractiveInkCanvas recognition and classification types must include the math value.

Note that for each example, you can access the "≡ → Math → ..." math graphical menu.

You can also refer to the configuration example that will give you an overview of possible math configuration options.

Math numerical computation

iinkTS is capable of detecting and solving equations, and it offers a high degree of flexibility in how solvable equations are handled.

  • You can choose to either add a button or a menu that allows your users to activate the solver manually, or configure your app to automatically solve every supported equation when users draw an equals sign at the end of an equation. Choose the option that is more appropriate for your use case!
  • When iinkTS gets an equation solving result, you can decide whether iinkTS should only display this result, or add it into iink model. In the latter case, the result is computed once per block and is never automatically recomputed or erased afterward.

For an overview of the math numerical computation possibilities, refer to this example and source code, which will guide you step-by-step:

Math variable management

iinkTS manages math variables according to the principles described in the variable management section.

iinkTS lets you select the way you want to manage variables. They can be auto-detected when users write definitions and expressions, or you can use a dedicated menu to define a global variable, or a API to define them within a block.

You can also provide visual feedback on the dependencies between linked math blocks to help clarify how blocks depend on variables.

Math capabilities full overview

In addition to math numerical computation and variable management, iinkTS also lets you define a function and sketch its graph.

When a math expression has no numerical computation output, it helps you understand why an action is not possible.

You can access the math capabilities of your entire canvas at any time using the graphical menu "≡ → Math → Show Math Capabilities Overview".

You may also want to access this context menu on a restricted selection within your canvas. With this example, you can write math content and access all possible actions on a selection by circling it and accessing the context menu.