Get started: Sample mathematics
Type Help MathFunctions for an extensive list of built-in mathematical functions.
By default, the imaginary number is named imaginary. To instead define i  as -1,  and do math with complex numbers, type
SetImaginaryNumber( i ) someNumber = sin(pi/2) + abs(-3) + sqrt(i) + exp(i*t) -> someNumber = 4.707107 + 0.7071068*i + cos(t) + i*sin(t)
Note: Use a symbol of your choice (such as  i,  j,  abc)  e.g., as  SetImaginaryNumber( abc )
Use the Expand command to eliminate parentheses, e.g.,
p = Expand( (1+t) * (2+t) * (3+t^2) ) -> p = 6 + 9*t + t^4 + 3*t^3 + 5*t^2
To evaluatep  at t = 2.3,  issue the command
p23 = Evaluate( p, t = 2.3 ) -> p23 = 117.6351
To determine the ordinary time-derivative of p, type
pDt = Dt( p ) -> pDt = 9 + 10*t + 4*t^3 + 9*t^2
pDt is a 3rd-order polynomial in t. Its 3 roots are calculated with
roots = GetCubicRoots( pDt = 0, t ) -> roots = [-1.5704; -0.3398 - 1.1477*i; -0.3398 + 1.1477*i]
To save commands (for subsequent re-use) or commands/responses, type
Save MGMathExampleA.txt % Save commands. Save MGMathExampleA.html % Save commands and responses.
Exit the program by typing Quit.
Various other mathematical commands
Command file MGMathExampleB.txt
Output responses MGMathExampleB.html
MotionGenesis™ also does vector algebra, matrix algebra and solves sets of linear equations or nonlinear equations, and ODEs (ordinary differential equations).