Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mgriebling/makemathml
- Owner: mgriebling
- Created: 2017-08-14T10:41:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-17T19:51:37.000Z (5 months ago)
- Last Synced: 2024-11-07T18:19:08.717Z (about 2 months ago)
- Language: Swift
- Size: 120 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
=
2b
=
a
+
3t
=
truep2
=π
2t
=
2a
+
2
⁢
b
−
3a
&
b2
bsin
-1(
sin
(
a
))
2
+a
2log
10(
1000
)ln
e
3b
2b
+
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)