Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 86c3d80c4d6e905f610c100030811165 > files > 34

mathomatic-14.5.5-1mdv2010.0.i586.rpm

; This is a line comment.  User input is given in bold.
; Equations are entered by just typing them in:
c^2=a^2+b^2 ; The Pythagorean theorem, "c" squared equals "a" squared plus "b" squared.
; The entered equation becomes the current equation and is displayed.
display ; The display command by itself displays the current equation again.
; The current equation can be solved by simply typing in a variable name:
c ; which is shorthand for the solve command.  Solve for variable "c".
; "sign" variables are special two-valued variables that may only be +1 or -1.
b ; Solve for variable "b".
; To output programming language code, use the code command:
code ; C language code is the default.

code java ; Mathomatic can also generate Java

code python ; and Python code.

; ********************************************************************
a=b+1/b ; Enter another equation; this is actually a quadratic equation.
0 ; Solve for zero.
unfactor ; Show that this is a quadratic polynomial equation in "b".
solve verify b ; Solve for variable "b", verifying the result.
a ; Solve back for "a" and we should get the original equation.
simplify ; The simplify command makes expressions simpler and prettier.
; ********************************************************************
; Mathomatic is also handy as an advanced calculator.
; Expressions without variables entered at the main prompt are instantly evaluated:
2+3
2^.5 ; The square root of 2, rounded to the default 14 digits:
e^(pi*i)+1 ; Euler's identity is made of the most important universal constants.
; ********************************************************************
; Symbolic logarithms like log(x) are currently not implemented in Mathomatic.
27^y=9 ; An example that uses numerical logarithms.
solve verify y ; Solve for y, verifying the result.
; ********************************************************************
0=2x^2-3x-20 ; A simple quadratic equation, to show how the calculate command works.
solve verify x ; Solve for x, plugging the result into the original equation to verify.
calculate ; Expand "sign" variables and approximate the RHS (Right Hand Side).
; The calculate command also allows you to plug values into a formula.
display; Show that nothing is modified by the calculate command.