To see the complete list of supported symbols, rules and operations, read this section.
MyScript iink SDK not only recognizes equations, it can also solve some of them! Its arithmetic solver can solve input equations under the following conditions:
Equations with one unknown can be solved. The way variables are managed depends on the part type, as explained in the next sections.
Equations with more than one unknown can be recognized and typeset, but not solved.
You can either choose to add a button so that your user will activate the solver manually or to have your app automatically solve every supported equation. Just choose what is more appropriate to your use case!
You can choose the angle unit (degree or radian), how many decimals you want displayed and whether you want results to be rounded or truncated. You can also decide to insert implicit multiply operators, perform syntactic correction or whether an equal sign should be present to trigger the solving.
➤ Refer to the math.solver.
configuration settings to see what you can control with the numerical computation action of the math solver.
By default math solver is activated but you can disable it.
When math solver is activated, converting the math will trigger solving, if the required conditions are in place. Equations with one unknown can be solved, but the variable has to be highlighted with a question mark, not a letter. Example: “4y × 2 = 24” won’t be solved whereas “4 × ? × 2 = 24” will.
MyScript iink SDK can also perform math animation (morphing) when converting math strokes to typeset.
By default this feature is disabled
but can be set up with the math.convert.animate
property.
The MathSolverController object is the entry point for interacting with your math content in a "Raw Content"
part or block with Editor and OffscreenEditor.
raw-content2
and math2
bundles.
The MathSolverController manages variables in mathematical expressions: variables are single letters, either Latin or Greek, with an optional positive integer subscript. Variable management can be:
math.solver.auto-variable-management.enable
property.
Manual meaning that variables that apply to a particular math block are managed by programmatically calling getVariableValue, setVariableValue and removeVariableValue methods of the MathSolverController.
If you enable automatic variable management, you can also use the manual APIs to set some variables or domain constants for example. API defined variables will apply with higher priority over automatically recognized ones.
The getVariables method gets information about all variables associated with a given block.
The MathSolverController has an evaluate method to calculate the outputs of an evaluable math block expression, for a given range of input values. This allows you to get plot-ready coordinates that you can use to plot graphs using a graphics library.
An expression is evaluable if it can be interpreted as a function of a given variable:
The getEvaluables method returns the list of evaluable variables for a “Math” block.
The MathSolverController can
To help you troubleshoot common pitfalls, the getDiagnostic method performs diagnostics on a given task and the specified block. It can be useful for:
Understand why getEvaluables() returns an empty array, by calling it with an evaluation
task.
Find out why getAvailableActions() does not include the numerical-computation
action in the returned array, by calling it with a numerical-computation
task.
The getDiagnostic also returns a MathDiagnostic code so that your application can get information about error situations, such as computation errors, and that you can map to a localized error message in your application to let end users know what’s going on.