embeer / math
tools for math exercising
v1.0.1
2022-11-21 00:29 UTC
Requires
- php: >=7.2.0
README
math
A few classes (for now actually only one) serving maths exercising.
v. 1.0.0
released on 20th March 2020
Usage
Class Expressions
Execute the below code to obtain an array of expressions coded for HTML ready to display in browser.
$expressions = (new Expressions($parameters))->getExpressions();
Example result
1<sup>4</sup>⁄<sub>6</sub> + (<sup>4</sup>⁄<sub>8</sub> + 2.1 + 6 + <sup>5</sup>⁄<sub>10</sub>) * <sup>3</sup>⁄<sub>4</sub> = <sup>5</sup>⁄<sub>10</sub> * <sup>5</sup>⁄<sub>5</sub> * (2<sup>1</sup>⁄<sub>3</sub> + <sup>1</sup>⁄<sub>6</sub> - 10) - 10 = 5 - 6 * (<sup>4</sup>⁄<sub>8</sub> - 6) + 4 = <sup>6</sup>⁄<sub>4</sub> - (6 : (-<sup>6</sup>⁄<sub>9</sub>) - 2) =
giving the following display
14⁄6 + (4⁄8 + 2.1 + 6 + 5⁄10) * 3⁄4 =
5⁄10 * 5⁄5 * (21⁄3 + 1⁄6 - 10) - 10 =
5 - 6 * (4⁄8 - 6) + 4 =
6⁄4 - (6 : (-6⁄9) - 2) =
Class internal variables are self documented. The defaults can be changed passing new values to the class constructor as an array of pairs "variableName" => variableValue
.
Note: :
(colon) stands for division operator symbol.