Mesa interfaces:
Complex - Operations on <complex> numbers.
LinearSystem - For solving systems of linear equations.
Polynomial - Operations on real polynomials.
Quadratic - Quadratic equation solver.
Vector - Operations on two-dimensional vectors.
JaM functions:
To use the JaM functions, load MathJaM.
Complex
Complex numbers are represented by two real numbers on top of the stack.
<complex> == <x: real> <y: imaginary>
Complex.Add <complex> <complex> => <complex>
Complex.Sub <complex> <complex> => <complex>
Complex.Mul <complex> <complex> => <complex>
Complex.Div <complex> <complex> => <complex>
Complex.FromPolar <radius: real> <angle: radians> => <complex>
Complex.Abs <complex> => <real>
Complex.SqrAbs <complex> => <real>
Complex.Arg <complex> => <angle: radians>
Complex.Exp <complex> => <complex>
Complex.Ln <complex> => <complex>
Complex.Sqr <complex> => <complex>
Complex.Sqrt <complex> => <complex>
LinearSystem
(should be reworked; for now the commands take the matrix in row-major order, followed by the right-hand column vector, and leave the solution vector on the stack. The matrices and vectors are pushed on the stack as a bunch of reals, with no additional structure.)
LinearSystem.Solve2
LinearSystem.Solve3
LinearSystem.Solve4
LinearSystem.Solve5
LinearSystem.Solve6
Polynomial
Polynomials are represented on the stack by the real coefficients, in decreasing order, followed by the degree.
<polynomial> == <cn: real> <cn-1: real> . . . <c0: real> <n: integer>
Polynomial.Eval <polynomial> <real> => <real>
Polynomial.Add <polynomial> => <polynomial>
Polynomial.Sub <polynomial> => <polynomial>
Polynomial.Mul <polynomial> => <polynomial>
Polynomial.Differentiate <polynomial> => <polynomial>
Polynomial.Integrate <polynomial> => <polynomial>
Polynomial.Roots <polynomial> => <polynomial>
(Quadratic and Vector do not have JaM commands)