Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mgriebling/makemathml

MakeMathML creates a MathML output of the text file passed to this command line program as the first argument.
https://github.com/mgriebling/makemathml

Last synced: 5 days ago
JSON representation

MakeMathML creates a MathML output of the text file passed to this command line program as the first argument.

Awesome Lists containing this project

README

        

MakeMathML creates a MathML output of the text file passed to this command line program as the first argument.
Also the set of input equations in the input file are evaluated and produce an output for each line terminated with a ";".

For example the following input file:

~~~
let a = 2; let b = a+3;
let t = true;
let p2 = pi/2;
let t = 2;
a + 2*b - 3;
a & b;
2^b;
asin(sin(a));
sqrt(2+a^2);
log(1000);
ln(exp(3));
b²;
~(b+c);
10!
~~~

produces this output:

~~~
Parsing
Proc
Block(
a = 2.0 => 2.0
b = (a ADD 3.0) => 5.0
t = true => 1.0
p2 = (pi DIV 2.0) => 1.5707963267948966
t = 2.0 => 2.0
((a ADD (2.0 MUL b)) SUB 3.0) => 9.0
(a AND b) => 0.0
(2.0 POW b) => 32.0
Built-in asin(Built-in sin(a)) => 1.1415926535897933
Built-in sqrt((2.0 ADD (a POW 2.0))) => 2.449489742783178
Built-in log(1000.0) => 3.0
Built-in ln(Built-in exp(3.0)) => 3.0
SQR b => 25.0
NOT (b ADD c) => -6.0
FACT 10.0 => 3628800.0
)

a
=
2

b
=
a
+
3

t
=
true

p2
=

π
2

t
=
2

a
+
2
⁢
b

3

a
&
b

2
b

sin
-1

(
sin
(
a
)

)

2
+

a
2

log
10

(
1000
)

ln

e
3

b
2

b
+
c

‾

10
!

Parsed correctly
Program ended with exit code: 0
~~~

The MathML output can be interpreted by most html browsers and produces the following:

![Screenshot 2024-08-17 at 3 43 53 PM](https://github.com/user-attachments/assets/cc210415-7b15-4b05-ae2d-0f6405a53321)