.lmm — Math / Matrices | LMX

LMX // .LMM

.lmmMath / Matrices

Vector accumulator + trigonometry + matrix algebra.

  • Runs here
  • a .lmm file
  • free to run
WHAT IT IS

Why .lmm exists.

A sequential math machine: operate element-wise on an accumulator (add/subtract/multiply/… , sin/cos/tan) and run matrix algebra (matrix_create/add/multiply/transpose/print).

Runs here

This one runs in the browser sandbox with no account, and offline in the CLI.


A WORKED EXAMPLE

demo.lmm

Takes inputs — Optional initial numbers — pass inputs as ["0,30,45,60,90"] or [0,30,45]..

add 10
multiply by 3
subtract 5
divide by 2
power of 2
Run it

1 more example

Start with a single value
# Start with a single value
set 1.5708 # roughly pi/2

# Trig operations
sin
# Accumulator should be [1]

# Set multiple values, including scientific notation
set 0 30 45 60 90 1.23e3

# Pop the last value (1230)
pop

# Convert degrees to radians (approx)
multiply 0.01745

# Apply cos to all elements
cos
# Accumulator should be [cos(0), cos(0.52), cos(0.78), cos(1.04), cos(1.57)]
# which is roughly [1, 0.86, 0.7, 0.5, 0]

# --- Matrix Operations ---
# Create two 2x2 matrices
matrix_create M1 2 2 1 2 3 4
matrix_create M2 2 2 5 6 7 8

# Print M1
matrix_print M1

# Add them
matrix_add M3 M1 M2
matrix_print M3

# Transpose M1
matrix_transpose M1T M1
matrix_print M1T

# Multiply M1 by its transpose
matrix_multiply M4 M1 M1T
matrix_print M4

# Multiply M4 by a scalar
matrix_scalar_multiply M4 10
matrix_print M4

SYNTAX

The shape of it.

Straight from the interpreter catalogue — the same summary the editor shows as a placeholder.

set 0 30 45 60 90
multiply 0.01745
cos
matrix_create M1 2 2 1 2 3 4
matrix_print M1

NEXT

Where to take it.