Skip to content

Commit 4416d67

Browse files
committed
examples: add basic examples
Basically from the site. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
1 parent 03586f0 commit 4416d67

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ You can try it online at https://felipec.github.io/math-notepad/.
66

77
This is a simplified version of [Engineering-Solver](https://github.com/dvd101x/Engineering-Solver)
88
plus syntax highlighting.
9+
10+
For a basic example check [basic](https://felipec.github.io/math-notepad/?input=https%3A%2F%2Fraw.githubusercontent.com%2Ffelipec%2Fmath-notepad%2Fmaster%2Fexamples%2Fbasic.mathjs).

examples/basic.mathjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Functions and constants
2+
3+
round(e, 3)
4+
atan2(3, -3) / pi
5+
log(10000, 10)
6+
sqrt(-4)
7+
derivative("x^2 + x", "x")
8+
pow([[-1, 2], [3, 1]], 2)
9+
10+
# Expressions
11+
12+
1.2 / (3.3 + 1.7)
13+
14+
a = 5.08 cm + 2 inch
15+
a to inch
16+
17+
sin(90 deg)
18+
19+
9 / 3 + 2i
20+
21+
det([-1, 2; 3, 1])
22+
23+
f(x, y) = x ^ y
24+
f(2, 3)
25+
26+
1 kg * 1 m / s^2
27+
28+
# Extra features
29+
30+
help('round')

0 commit comments

Comments
 (0)