User Tools

Site Tools


code:functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
code:functions [2015/04/11 14:24]
skylarmt [Simple Math]
code:functions [2019/04/16 02:40] (current)
Line 1: Line 1:
 ====== Built-in Functions ====== ====== Built-in Functions ======
  
-SyMAT has many built-in functions. ​ These are available from JavaScript and Python. +SyMAT has many built-in functions. ​ These are available from JavaScript, Python, ​and Java.
- +
-<WRAP center round info 60%> +
-This page is incomplete. +
- +
-Reason: Not all functions are documented yet. +
-</​WRAP>​+
  
 <WRAP box 60%> <WRAP box 60%>
Line 15: Line 9:
 ===== Symbols ===== ===== Symbols =====
  
-These are only some symbols present in SyMAT. ​ Because of differences between ​JavaScript and Python, syntax-specific symbols are omitted.+These are only some of the symbols present in SyMAT. ​ Because of differences between ​coding languages, syntax-specific symbols are omitted.
  
   * ''​%%+%%'':​ Addition.   * ''​%%+%%'':​ Addition.
Line 24: Line 18:
   * ''​%%,​%%'':​ Separates arguments in functions.   * ''​%%,​%%'':​ Separates arguments in functions.
   * ''​%%"​%%'':​ (Double quote) Denotes the start and end of text (strings).   * ''​%%"​%%'':​ (Double quote) Denotes the start and end of text (strings).
-  * ''​%%'​%%'':​ (Single quote) Same as the double quote above.+  * ''​%%'​%%'':​ (Single quote) Same as the double quote above (except in Java).
   * ''​%%=%%'':​ Assign a value to a variable. ​ ''​%%x=5%%''​ will assign the value 5 to variable x.   * ''​%%=%%'':​ Assign a value to a variable. ​ ''​%%x=5%%''​ will assign the value 5 to variable x.
  
Line 36: Line 30:
   * ''​%%load(key)%%'':​ Return the text corresponding to the given key.   * ''​%%load(key)%%'':​ Return the text corresponding to the given key.
   * ''​%%save(key,​text)%%'':​ Link the given text to the given key.   * ''​%%save(key,​text)%%'':​ Link the given text to the given key.
 +  * ''​%%filedialog()%%'':​ Show a file selection dialog and return the chosen file path.
 +  * ''​%%textbox()%%'':​ Returns an instance of a [[tutorial:​textandweb#​text_box|multiline text box]].
 +  * ''​%%browser()%%'':​ Returns an instance of a [[tutorial:​textandweb#​browser|web browser]].
  
-===== Simple ​Math =====+===== Basic Math and Algebra ​=====
   * ''​%%add(n,​n,​n...)%%''​ or ''​%%add(n[])%%'':​ Add together the given numbers or array of numbers and return the sum.   * ''​%%add(n,​n,​n...)%%''​ or ''​%%add(n[])%%'':​ Add together the given numbers or array of numbers and return the sum.
   * ''​%%subtract(n,​n,​n...)%%''​ or ''​%%subtract(n[])%%'':​ Subtract the given numbers or array of numbers and return the difference. ​ Calculates from first number to last (i.e. n1-n2-n3).   * ''​%%subtract(n,​n,​n...)%%''​ or ''​%%subtract(n[])%%'':​ Subtract the given numbers or array of numbers and return the difference. ​ Calculates from first number to last (i.e. n1-n2-n3).
Line 50: Line 47:
   * ''​%%ceil(n)%%'':​ Round n up to the nearest larger integer.   * ''​%%ceil(n)%%'':​ Round n up to the nearest larger integer.
   * ''​%%floor(n)%%'':​ Round n down to the nearest smaller integer.   * ''​%%floor(n)%%'':​ Round n down to the nearest smaller integer.
 +  * ''​%%solve(f,​x,​n)%%'':​ Calculate the values of x that make function f equal to n and return an array.
 +
 +===== Advanced Math =====
 +  * ''​%%primes(n)%%'':​ Find all prime numbers less than n and return them in an array.
 +  * ''​%%isprime(n)%%'':​ Calculates if the given number is prime.
 +  * ''​%%gcd(n1,​n2)%%'':​ Find the greatest common divisor of n1 and n2.
 +  * ''​%%diff(f,​x)%%'':​ Differentiate function f with respect to variable x.
 +  * ''​%%integrate(f,​x)%%'':​ Integrate function f with respect to variable x.
  
 ===== Graphing ===== ===== Graphing =====
Line 74: Line 79:
   * ''​%%acos(n)%%'':​ Find the Arccosine (inverse cosine) of the given number.   * ''​%%acos(n)%%'':​ Find the Arccosine (inverse cosine) of the given number.
   * ''​%%atan(n)%%'':​ Find the Arctangent (inverse tangent) of the given number.   * ''​%%atan(n)%%'':​ Find the Arctangent (inverse tangent) of the given number.
 +  * ''​%%sinh(n)%%'':​ Find the hyperbolic sine of the given number.
 +  * ''​%%cosh(n)%%'':​ Find the hyperbolic cosine of the given number.
 +  * ''​%%tanh(n)%%'':​ Find the hyperbolic tangent of the given number.
 +  * ''​%%sec(n)%%'':​ Find the secant of the given number in radians.
 +  * ''​%%csc(n)%%'':​ Find the cosecant of the given number in radians.
 +  * ''​%%cot(n)%%'':​ Find the cotangent of the given number in radians.
 +  * ''​%%asec(n)%%'':​ Find the inverse secant of the given number.
 +  * ''​%%acsc(n)%%'':​ Find the inverse cosecant of the given number.
 +  * ''​%%acot(n)%%'':​ Find the inverse cotangent of the given number.
 +  * ''​%%sech(n)%%'':​ Find the hyperbolic secant of the given number.
 +  * ''​%%csch(n)%%'':​ Find the hyperbolic cosecant of the given number.
 +  * ''​%%coth(n)%%'':​ Find the hyperbolic cotangent of the given number.
   * ''​%%deg(n)%%'':​ Convert the given radians to degrees.   * ''​%%deg(n)%%'':​ Convert the given radians to degrees.
   * ''​%%rad(n)%%'':​ Convert the given degrees to radians.   * ''​%%rad(n)%%'':​ Convert the given degrees to radians.
 +
 +===== Matrix Operations =====
 +  * ''​%%mtimes(m1,​m2)%%'':​ Multiply the given matrices together.
 +  * ''​%%mpower(m,​n)%%'':​ Raise m to the power n.
 +  * ''​%%minvert(m)%%'':​ Invert the given matrix.
 +  * ''​%%printa(m)%%'':​ Get a textual representation of the given array or matrix.
code/functions.1428783875.txt.gz · Last modified: 2019/04/16 02:40 (external edit)