Here are the details of numerical operands:
Surface Plotter defines two constants:
e natural number value = 2.7182818.. pi area of circle with radius 1 value = 3.14159265..
Valid variables are x and y.
To set the minimum value and maximum value of these variables, use the setting panel
at the right side.
For more information, see: settings
abs(x) returns the absolute value of x acos(x) returns the arc cosine of x acosh(x) returns the inverse hyperbolic cosine of x asin(x) returns the arc sine of x asinh(x) returns the inverse hyperbolic sine of x atan(x) returns the arc tangent of x atanh(x) returns the inverse hyperbolic tangent of x ceil(x) rounds x up to the nearest integer cos(x) returns the cosine of x cosh(x) returns the hyperbolic cosine of x exp(x) returns the exponential of x floor(x) rounds x down to the nearest integer frac(x) returns the fraction part of x int(x) returns the integer part of x ln(x) returns the natural logarithm of x log(x) returns the base-10 logarithm of x round(x) rounds x to the nearest integer sign(x) returns -1 if x < 0, 1 if x > 0, and 0 if x = 0 sin(x) returns the sine of x sinh(x) returns the hyperbolic sine of x sqr(x) returns x * x sqrt(x) returns the square root of x tan(x) returns the tangent of x tanh(x) returns the hyperbolic tangent of x Surface Plotter version 1.20 or newer: min(a,b) returns the smaller value of a and b max(a,b) returns the greater value of a and b atan2(a,b) computes the phase theta by computing an arc tangent of b/a in the range -pi to pi mod(a,b) returns the remainder of a divided by b as defined by IEEE 754Note:
------------------------------------------------------------------------------ Operator Precedence Operation Category Associativity ------------------------------------------------------------------------------ + First (high) sign identity unary right to left - sign negation ------------------------------------------------------------------------------ ^ Second power power right to left ------------------------------------------------------------------------------ * Third multiplication multiplication left to right / division ------------------------------------------------------------------------------ + Fourth addition addition left to right - substraction ------------------------------------------------------------------------------Note: Expressions within parentheses are evaluated before being treated as a single operand.
Since version 1.10, Surface Plotter's function parser recognizes relational operators and boolean operators.
if(conditional statement, expression1, expression2)
Surface Plotter will evaluate expression1 if
conditional statement is evaluated to true and expression2 otherwise.
if(x < 0, -x, x)
is -x if x is less than zero and x otherwise (absolute of x)
z = (fx,y) = sin(if(x < 0; 2*x, 3*x))
And for the last, you can nest "if" functions. For example, you can write sign(x) as:
z = f(x,y) = if(x <= 0, if(x = 0, 0, -1), 1)
Relational operators and Boolean operators
Here is the list of valid relational operators and boolean operators:
------------------------------------------------------------------------------
Operator Operation Category Operand Type(s)
------------------------------------------------------------------------------
< less than relational numerical expression
> greater than relational numerical expression
<= less than or equal relational numerical expression
>= greater than or equal relational numerical expression
= equal relational numerical expression
<> not equal relational numerical expression
& logical and boolean boolean expression
| logical or boolean boolean expression
! logical inversion boolean boolean expression
------------------------------------------------------------------------------
Note: All operators listed above produce boolean type result. The result can only be used as the
conditional statement for "if" function.
The "if" function
The "if" function has the following syntax:
For example, the result of the following statement
The following expressions are also valid:
z = f(x,y) = if(x = 0,0,sin(x)/x) - 2
Back
Send comments, suggestions, bug reports to Yanto Suryono