提交 bca7216f authored 作者: Travis Cross's avatar Travis Cross

Run dos2unix on mod_expr HTML files

上级 65e678ba
This source diff could not be displayed because it is too large. You can view the blob instead.
<html> <html>
<head> <head>
<title>Expression Help</title> <title>Expression Help</title>
<style type="text/css"> <style type="text/css">
.valid { .valid {
color: #00AA00; color: #00AA00;
} }
.invalid { .invalid {
color: #FF0000; color: #FF0000;
} }
.excomment { .excomment {
color: #0000FF; color: #0000FF;
} }
.container { .container {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
padding-left: 4px; padding-left: 4px;
padding-right: 4px; padding-right: 4px;
border-top: 1px solid #000000; border-top: 1px solid #000000;
border-right: 1px solid #000000; border-right: 1px solid #000000;
border-bottom: 1px solid #000000; border-bottom: 1px solid #000000;
border-left: 1px solid #000000; border-left: 1px solid #000000;
background-color: #BBBBBB; background-color: #BBBBBB;
} }
body { body {
background-color: #AAAAAA; background-color: #AAAAAA;
} }
</style> </style>
</head> </head>
<body> <body>
<div align="center"> <div align="center">
<h1>Expression Help</h1> <h1>Expression Help</h1>
<hr> <hr>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2>Contents</h2> <h2>Contents</h2>
<h3> <h3>
<ul> <ul>
<li><a href="#Syntax">Expression Syntax</a></li> <li><a href="#Syntax">Expression Syntax</a></li>
<li><a href="#Operators">Order of Operators</a></li> <li><a href="#Operators">Order of Operators</a></li>
<li><a href="#InternalFunc">ExprEval Internal Functions</a></li> <li><a href="#InternalFunc">ExprEval Internal Functions</a></li>
<li><a href="#InternalConst">ExprEval Internal Constants</a></li> <li><a href="#InternalConst">ExprEval Internal Constants</a></li>
<li><a href="#AppFunc">Application Internal Functions</a></li> <li><a href="#AppFunc">Application Internal Functions</a></li>
<li><a href="#AppConst">Application Internal Constants</a></li> <li><a href="#AppConst">Application Internal Constants</a></li>
<li><a href="#AppVar">Application Internal Variables</a></li> <li><a href="#AppVar">Application Internal Variables</a></li>
</ul> </ul>
</h3> </h3>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="Syntax">Expression Syntax</a></h2> <h2><a name="Syntax">Expression Syntax</a></h2>
<blockquote> <blockquote>
<p>Expressions have pretty much the same syntax as they <p>Expressions have pretty much the same syntax as they
would have on paper, with the following exceptions: would have on paper, with the following exceptions:
<ul> <ul>
<li>Each expression must end with a semicolon. This <li>Each expression must end with a semicolon. This
is because the expression string can actually is because the expression string can actually
contain multiple expressions. The semicolon is contain multiple expressions. The semicolon is
used to mark the end of the expression.<br> used to mark the end of the expression.<br>
<b>Examples:</b> <b>Examples:</b>
<ul> <ul>
<li>4*x+5;</li> <li>4*x+5;</li>
<li>y=5+2;g=4+6;</li> <li>y=5+2;g=4+6;</li>
<li>y=r*sin(a);x=r*cos(a);</li> <li>y=r*sin(a);x=r*cos(a);</li>
</ul> </ul>
</li> </li>
<li>The asterisk '*' must be used to multiply.<br> <li>The asterisk '*' must be used to multiply.<br>
<b>Examples:</b> <b>Examples:</b>
<ul> <ul>
<li>y=5*6; <b class="valid">Valid</b></li> <li>y=5*6; <b class="valid">Valid</b></li>
<li>g=(x+1)*(x-1); <b class="valid">Valid</b></li> <li>g=(x+1)*(x-1); <b class="valid">Valid</b></li>
<li>g=(x+1)(x-1); <b class="invalid">Invalid</b></li> <li>g=(x+1)(x-1); <b class="invalid">Invalid</b></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</p> </p>
<p>More than one expression may be contained within an expression string. <p>More than one expression may be contained within an expression string.
As shown above, each expression must end with a semicolon, even if As shown above, each expression must end with a semicolon, even if
only one expression is in the string. The value of an expression only one expression is in the string. The value of an expression
string is the value of the last expression in the string.<br> string is the value of the last expression in the string.<br>
<b>Examlples:</b> <b>Examlples:</b>
<ul> <ul>
<li>g=7; <b class="excomment">Value: 7</b></li> <li>g=7; <b class="excomment">Value: 7</b></li>
<li>k=z+1; <b class="excomment">Value: z+1</b></li> <li>k=z+1; <b class="excomment">Value: z+1</b></li>
<li>r=4;k=6;o=9+r-k; <b class="excomment">Value: 9+r-k</b></li> <li>r=4;k=6;o=9+r-k; <b class="excomment">Value: 9+r-k</b></li>
</ul> </ul>
</p> </p>
<p>Some functions may take reference parameters. These parameters are <p>Some functions may take reference parameters. These parameters are
references to other variables. You can mix reference parameters references to other variables. You can mix reference parameters
with normal parameters. The order of the normal parameters must with normal parameters. The order of the normal parameters must
remain the same and the order of the reference parameters must remain the same and the order of the reference parameters must
remain the same.<br> remain the same.<br>
<b>Examples:</b> <b>Examples:</b>
<ul> <ul>
<li>min(1,2,3,4,&mval); <b class="excomment">&mval is a reference to a variable mval</b></li> <li>min(1,2,3,4,&mval); <b class="excomment">&mval is a reference to a variable mval</b></li>
<li>min(1,2,&mval,3,4); <b class="excomment">You may mix them inside like this.</b></li> <li>min(1,2,&mval,3,4); <b class="excomment">You may mix them inside like this.</b></li>
<li>min(1,2,(&mval),3,4); <b class="invalid">You may not nest reference parameters in any way</b></li> <li>min(1,2,(&mval),3,4); <b class="invalid">You may not nest reference parameters in any way</b></li>
</ul> </ul>
</p> </p>
<p>Expressions may also be nested with parenthesis.<br> <p>Expressions may also be nested with parenthesis.<br>
<b>Examples:</b> <b>Examples:</b>
<ul> <ul>
<li>y=sin(x-cos(5+max(4,5,6*x)));</li> <li>y=sin(x-cos(5+max(4,5,6*x)));</li>
<li>6+(5-2*(x+y));</li> <li>6+(5-2*(x+y));</li>
</ul> </ul>
</p> </p>
<p>Expressions may also have whitespace characters and comments. <p>Expressions may also have whitespace characters and comments.
Whitespace characters such as newlines, linefeeds, carriage Whitespace characters such as newlines, linefeeds, carriage
returns, spaces, and tabs are ignored. Comments begin with returns, spaces, and tabs are ignored. Comments begin with
the pound sign '#' and end at the end of the line.<br> the pound sign '#' and end at the end of the line.<br>
<b>Example:</b> <b>Example:</b>
<ul> <ul>
<pre> <pre>
#Set the x value #Set the x value
x = d * cos(r); x = d * cos(r);
#Set the y value #Set the y value
y = d * sin(r); y = d * sin(r);
</pre> </pre>
</ul> </ul>
</p> </p>
<p>If a variable is used in an expression, but that variable does not exist, <p>If a variable is used in an expression, but that variable does not exist,
it is considered zero. If it does exist then its value is used instead. it is considered zero. If it does exist then its value is used instead.
</p> </p>
<p><b>Notice:</b> An expression can <b>NOT</b> assign to a constant and an <p><b>Notice:</b> An expression can <b>NOT</b> assign to a constant and an
expression can <b>NOT</b> use a constant as a reference parameter. expression can <b>NOT</b> use a constant as a reference parameter.
</p> </p>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="Operators">Order of operators.</a></h2> <h2><a name="Operators">Order of operators.</a></h2>
<blockquote> <blockquote>
<p>The order of operators are processed correctly in ExprEval. <p>The order of operators are processed correctly in ExprEval.
The parameters to functions may be evaluated out of order, depending The parameters to functions may be evaluated out of order, depending
on the function itself.</p> on the function itself.</p>
The following illustrates the order of operators: The following illustrates the order of operators:
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Operator</b></td> <td align="center"><b>Operator</b></td>
<td align="center"><b>Direction</b></td> <td align="center"><b>Direction</b></td>
<td align="center"><b>Example</b></td> <td align="center"><b>Example</b></td>
</tr> </tr>
<tr> <tr>
<td>Functions and Parenthesis</td> <td>Functions and Parenthesis</td>
<td>N/A</td> <td>N/A</td>
<td>(x + 5) * sin(d);</td> <td>(x + 5) * sin(d);</td>
</tr> </tr>
<tr> <tr>
<td>Negation</td> <td>Negation</td>
<td>Right to Left</td> <td>Right to Left</td>
<td>y = -2;</td> <td>y = -2;</td>
</tr> </tr>
<tr> <tr>
<td>Exponents</td> <td>Exponents</td>
<td>Left to Right</td> <td>Left to Right</td>
<td>y = x ^ 2;</td> <td>y = x ^ 2;</td>
</tr> </tr>
<tr> <tr>
<td>Multiplication and Division</td> <td>Multiplication and Division</td>
<td>Left to Right</td> <td>Left to Right</td>
<td>x * 5 / y;</td> <td>x * 5 / y;</td>
</tr> </tr>
<tr> <tr>
<td>Addition and Subtraction</td> <td>Addition and Subtraction</td>
<td>Left to Right</td> <td>Left to Right</td>
<td>4 + 5 - 3;</td> <td>4 + 5 - 3;</td>
</tr> </tr>
<tr> <tr>
<td>Assignment</td> <td>Assignment</td>
<td>Right to Left</td> <td>Right to Left</td>
<td>x = y = z = 0;</td> <td>x = y = z = 0;</td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="InternalFunc">ExprEval Internal Functions</a></h2> <h2><a name="InternalFunc">ExprEval Internal Functions</a></h2>
<blockquote> <blockquote>
The following functions are provided with ExprEval: The following functions are provided with ExprEval:
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Function</b></td> <td align="center"><b>Function</b></td>
<td align="center"><b>Min. Args</b></td> <td align="center"><b>Min. Args</b></td>
<td align="center"><b>Max. Args</b></td> <td align="center"><b>Max. Args</b></td>
<td align="center"><b>Min. Ref Args</b></td> <td align="center"><b>Min. Ref Args</b></td>
<td align="center"><b>Max. Ref Args</b></td> <td align="center"><b>Max. Ref Args</b></td>
<td align="center"><b>Result/Comment</b></td> <td align="center"><b>Result/Comment</b></td>
</tr> </tr>
<tr> <tr>
<td>abs(v)</td> <td>abs(v)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Absolute value of v.<br> <td>Absolute value of v.<br>
abs(-4.3) returns 4.3</td> abs(-4.3) returns 4.3</td>
</tr> </tr>
<tr> <tr>
<td>mod(v,d)</td> <td>mod(v,d)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Remainder of v/d.<br> <td>Remainder of v/d.<br>
mod(5.2,2.5) return 0.2</td> mod(5.2,2.5) return 0.2</td>
</tr> </tr>
<tr> <tr>
<td>ipart(v)</td> <td>ipart(v)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The integer part of v.<br> <td>The integer part of v.<br>
ipart(3.2) returns 3</td> ipart(3.2) returns 3</td>
</tr> </tr>
<tr> <tr>
<td>fpart(v)</td> <td>fpart(v)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The fractional part of v.<br> <td>The fractional part of v.<br>
fpart(3.2) returns 0.2</td> fpart(3.2) returns 0.2</td>
</tr> </tr>
<tr> <tr>
<td>min(v,...)</td> <td>min(v,...)</td>
<td>1</td> <td>1</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The minimum number passed.<br> <td>The minimum number passed.<br>
min(3,2,-5,-2,7) returns -5</td> min(3,2,-5,-2,7) returns -5</td>
</tr> </tr>
<tr> <tr>
<td>max(v,...)</td> <td>max(v,...)</td>
<td>1</td> <td>1</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The maximum number passed.<br> <td>The maximum number passed.<br>
max(3,2,-5,-2,7) returns 7</td> max(3,2,-5,-2,7) returns 7</td>
</tr> </tr>
<tr> <tr>
<td>pow(a,b)</td> <td>pow(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The value a raised to the power b.<br> <td>The value a raised to the power b.<br>
pow(3.2,1.7) returns 3.2<sup>1.7</sup></td> pow(3.2,1.7) returns 3.2<sup>1.7</sup></td>
</tr> </tr>
<tr> <tr>
<td>sqrt(a)</td> <td>sqrt(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The square root of a.</br> <td>The square root of a.</br>
sqrt(16) returns 4</td> sqrt(16) returns 4</td>
</tr> </tr>
<tr> <tr>
<td>sin(a)</td> <td>sin(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The sine of a radians.<br> <td>The sine of a radians.<br>
sin(1.5) returns around 0.997</td> sin(1.5) returns around 0.997</td>
</tr> </tr>
<tr> <tr>
<td>sinh(a)</td> <td>sinh(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The hyperbolic sine of a.<br> <td>The hyperbolic sine of a.<br>
sinh(1.5) returns around 2.129</td> sinh(1.5) returns around 2.129</td>
</tr> </tr>
<tr> <tr>
<td>asin(a)</td> <td>asin(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The arc-sine of a in radians.<br> <td>The arc-sine of a in radians.<br>
asin(0.5) returns around 0.524</td> asin(0.5) returns around 0.524</td>
</tr> </tr>
<tr> <tr>
<td>cos(a)</td> <td>cos(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The cosine of a radians.<br> <td>The cosine of a radians.<br>
cos(1.5) returns around 0.0707</td> cos(1.5) returns around 0.0707</td>
</tr> </tr>
<tr> <tr>
<td>cosh(a)</td> <td>cosh(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The hyperbolic cosine of a.</br> <td>The hyperbolic cosine of a.</br>
cosh(1.5) returns around 2.352</td> cosh(1.5) returns around 2.352</td>
</tr> </tr>
<tr> <tr>
<td>acos(a)</td> <td>acos(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The arc-cosine of a in radians.<br> <td>The arc-cosine of a in radians.<br>
acos(0.5) returns around 1.047</td> acos(0.5) returns around 1.047</td>
</tr> </tr>
<tr> <tr>
<td>tan(a)</td> <td>tan(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The tangent of a radians.<br> <td>The tangent of a radians.<br>
tan(1.5) returns around 14.101</td> tan(1.5) returns around 14.101</td>
</tr> </tr>
<tr> <tr>
<td>tanh(a)</td> <td>tanh(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The hyperbolic tangent of a.</br> <td>The hyperbolic tangent of a.</br>
tanh(1.5) returns around 0.905</td> tanh(1.5) returns around 0.905</td>
</tr> </tr>
<tr> <tr>
<td>atan(a)</td> <td>atan(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The arc-tangent of a in radians.<br> <td>The arc-tangent of a in radians.<br>
atan(0.3) returns about 0.291</td> atan(0.3) returns about 0.291</td>
</tr> </tr>
<tr> <tr>
<td>atan2(y,x)</td> <td>atan2(y,x)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The arc-tangent of y/x, with quadrant correction.<br> <td>The arc-tangent of y/x, with quadrant correction.<br>
atan2(4,3) returns about 0.927</td> atan2(4,3) returns about 0.927</td>
</tr> </tr>
<tr> <tr>
<td>log(a)</td> <td>log(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The base 10 logarithm of a.<br> <td>The base 10 logarithm of a.<br>
log(100) returns 2</td> log(100) returns 2</td>
</tr> </tr>
<tr> <tr>
<td>pow10(a)</td> <td>pow10(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>10 raised to the power of a.<br> <td>10 raised to the power of a.<br>
pow10(2) returns 100</td> pow10(2) returns 100</td>
</tr> </tr>
<tr> <tr>
<td>ln(a)</td> <td>ln(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The base e logarithm of a.<br> <td>The base e logarithm of a.<br>
ln(2.8) returns around 1.030</td> ln(2.8) returns around 1.030</td>
</tr> </tr>
<tr> <tr>
<td>exp(a)</td> <td>exp(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>e raised to the power of a.<br> <td>e raised to the power of a.<br>
exp(2) returns around 7.389</td> exp(2) returns around 7.389</td>
</tr> </tr>
<tr> <tr>
<td>logn(a,b)</td> <td>logn(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>The base b logarithm of a.<br> <td>The base b logarithm of a.<br>
logn(16,2) returns 4</td> logn(16,2) returns 4</td>
</tr> </tr>
<tr> <tr>
<td>ceil(a)</td> <td>ceil(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Rounds a up to the nearest integer.<br> <td>Rounds a up to the nearest integer.<br>
ceil(3.2) returns 4</td> ceil(3.2) returns 4</td>
</tr> </tr>
<tr> <tr>
<td>floor(a)</td> <td>floor(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Rounds a down to the nearest integer.<br> <td>Rounds a down to the nearest integer.<br>
floor(3.2) returns 3</td> floor(3.2) returns 3</td>
</tr> </tr>
<tr> <tr>
<td>rand(&seed)</td> <td>rand(&seed)</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>Returns a number between 0 up to but not including 1.</td> <td>Returns a number between 0 up to but not including 1.</td>
</tr> </tr>
<tr> <tr>
<td>random(a,b,&seed)</td> <td>random(a,b,&seed)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>Returns a number between a up to and including b.</td> <td>Returns a number between a up to and including b.</td>
</tr> </tr>
<tr> <tr>
<td>randomize(&seed)</td> <td>randomize(&seed)</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>Seed the random number generator with a value <td>Seed the random number generator with a value
based on the current time.<br> based on the current time.<br>
Return value is unknown</td> Return value is unknown</td>
</tr> </tr>
<tr> <tr>
<td>deg(a)</td> <td>deg(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns a radians converted to degrees.<br> <td>Returns a radians converted to degrees.<br>
deg(3.14) returns around 179.909</td> deg(3.14) returns around 179.909</td>
</tr> </tr>
<tr> <tr>
<td>rad(a)</td> <td>rad(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns a degrees converted to radians.<br> <td>Returns a degrees converted to radians.<br>
rad(180) returns around 3.142</td> rad(180) returns around 3.142</td>
</tr> </tr>
<tr> <tr>
<td>recttopolr(x,y)</td> <td>recttopolr(x,y)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns the polar radius of the rectangular co-ordinates.<br> <td>Returns the polar radius of the rectangular co-ordinates.<br>
recttopolr(2,3) returns around 3.606</td> recttopolr(2,3) returns around 3.606</td>
</tr> </tr>
<tr> <tr>
<td>recttopola(x,y)</td> <td>recttopola(x,y)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns the polar angle (0...2PI) in radians of the rectangular co-ordinates.<br> <td>Returns the polar angle (0...2PI) in radians of the rectangular co-ordinates.<br>
recttopola(2,3) returns around 0.588</td> recttopola(2,3) returns around 0.588</td>
</tr> </tr>
<tr> <tr>
<td>poltorectx(r,a)</td> <td>poltorectx(r,a)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns the x rectangular co-ordinate of the polar <td>Returns the x rectangular co-ordinate of the polar
co-ordinates.<br> co-ordinates.<br>
poltorectx(3,1.5) returns around 0.212</td> poltorectx(3,1.5) returns around 0.212</td>
</tr> </tr>
<tr> <tr>
<td>poltorecty(r,a)</td> <td>poltorecty(r,a)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns the y rectangular co-ordinate of the polar <td>Returns the y rectangular co-ordinate of the polar
co-ordinates.<br> co-ordinates.<br>
poltorecty(3,1.5) returns around 2.992</td> poltorecty(3,1.5) returns around 2.992</td>
</tr> </tr>
<tr> <tr>
<td>if(c,t,f)</td> <td>if(c,t,f)</td>
<td>3</td> <td>3</td>
<td>3</td> <td>3</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Evaluates and returns t if c is not 0.0. <td>Evaluates and returns t if c is not 0.0.
Else evaluates and returns f.<br> Else evaluates and returns f.<br>
if(0.1,2.1,3.9) returns 2.1</td> if(0.1,2.1,3.9) returns 2.1</td>
</tr> </tr>
<tr> <tr>
<td>select(c,n,z[,p])</td> <td>select(c,n,z[,p])</td>
<td>3</td> <td>3</td>
<td>4</td> <td>4</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns n if c is less than 0.0. Returns z <td>Returns n if c is less than 0.0. Returns z
if c is 0.0. If c is greater than 0.0 and only if c is 0.0. If c is greater than 0.0 and only
three arguments were passed, returns z. If c three arguments were passed, returns z. If c
is greater than 0.0 and four arguments were passed, is greater than 0.0 and four arguments were passed,
return p.<br> return p.<br>
select(3,1,4,5) returns 5</td> select(3,1,4,5) returns 5</td>
</tr> </tr>
<tr> <tr>
<td>equal(a,b)</td> <td>equal(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 1.0 if a is equal to b. Else returns 0.0<br> <td>Returns 1.0 if a is equal to b. Else returns 0.0<br>
equal(3,2) returns 0.0</td> equal(3,2) returns 0.0</td>
</tr> </tr>
<tr> <tr>
<td>above(a,b)</td> <td>above(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 1.0 if a is above b. Else returns 0.0<br> <td>Returns 1.0 if a is above b. Else returns 0.0<br>
above(3,2) returns 1.0</td> above(3,2) returns 1.0</td>
</tr> </tr>
<tr> <tr>
<td>below(a,b)</td> <td>below(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 1.0 if a is below b. Else returns 0.0<br> <td>Returns 1.0 if a is below b. Else returns 0.0<br>
below(3,2) returns 0.0</td> below(3,2) returns 0.0</td>
</tr> </tr>
<tr> <tr>
<td>avg(a,...)</td> <td>avg(a,...)</td>
<td>1</td> <td>1</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns the average of the values passed.<br> <td>Returns the average of the values passed.<br>
avg(3,3,6) returns 4</td> avg(3,3,6) returns 4</td>
</tr> </tr>
<tr> <tr>
<td>clip(v,min,max)</td> <td>clip(v,min,max)</td>
<td>3</td> <td>3</td>
<td>3</td> <td>3</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Clips v to the range from min to max. If v is less <td>Clips v to the range from min to max. If v is less
than min, it returns min. If v is greater than than min, it returns min. If v is greater than
max it returns max. Otherwise it returns v.<br> max it returns max. Otherwise it returns v.<br>
clip(3,1,2) returns 2</td> clip(3,1,2) returns 2</td>
</tr> </tr>
<tr> <tr>
<td>clamp(v,min,max)</td> <td>clamp(v,min,max)</td>
<td>3</td> <td>3</td>
<td>3</td> <td>3</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Clamps v to the range from min to max, looping <td>Clamps v to the range from min to max, looping
if needed.<br> if needed.<br>
clamp(8.2,1.3,4.7) returns 1.4</td> clamp(8.2,1.3,4.7) returns 1.4</td>
</tr> </tr>
<tr> <tr>
<td>pntchange(side1old, side2old, side1new, side2new, oldpnt)</td> <td>pntchange(side1old, side2old, side1new, side2new, oldpnt)</td>
<td>5</td> <td>5</td>
<td>5</td> <td>5</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>This is used to translate points from different <td>This is used to translate points from different
scale. It works no matter the orientation as long scale. It works no matter the orientation as long
as the sides are lined up correctly.<br> as the sides are lined up correctly.<br>
pntchange(-1,1,0,480,-0.5) returns 120 (x example)<br> pntchange(-1,1,0,480,-0.5) returns 120 (x example)<br>
pntchange(-1,1,480,0,-0.5) returns 360 (y example)</td> pntchange(-1,1,480,0,-0.5) returns 360 (y example)</td>
</tr> </tr>
<tr> <tr>
<td>poly(x,c1,...)</td> <td>poly(x,c1,...)</td>
<td>2</td> <td>2</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>This function calculates the polynomial. x is the value <td>This function calculates the polynomial. x is the value
to use in the polynomial. c1 and on are the coefficients.<br> to use in the polynomial. c1 and on are the coefficients.<br>
poly(4,6,9,3,1,4) returns 2168<br> poly(4,6,9,3,1,4) returns 2168<br>
same as 6*4<sup>4</sup> + 9*4<sup>3</sup> + 3*4<sup>2</sup> + 1*4<sup>1</sup> + 4*4<sup>0</sup></td> same as 6*4<sup>4</sup> + 9*4<sup>3</sup> + 3*4<sup>2</sup> + 1*4<sup>1</sup> + 4*4<sup>0</sup></td>
</tr> </tr>
<tr> <tr>
<td>and(a,b)</td> <td>and(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 0.0 if either a or b are 0.0 Else returns 1.0<br> <td>Returns 0.0 if either a or b are 0.0 Else returns 1.0<br>
and(2.1,0.0) returns 0.0</td> and(2.1,0.0) returns 0.0</td>
</tr> </tr>
<tr> <tr>
<td>or(a,b)</td> <td>or(a,b)</td>
<td>2</td> <td>2</td>
<td>2</td> <td>2</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 0.0 if both a and b are 0.0 Else returns 1.0<br> <td>Returns 0.0 if both a and b are 0.0 Else returns 1.0<br>
or(2.1,0.0) returns 1.0</td> or(2.1,0.0) returns 1.0</td>
</tr> </tr>
<tr> <tr>
<td>not(a)</td> <td>not(a)</td>
<td>1</td> <td>1</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>Returns 1.0 if a is 0.0 Else returns 0.0<br> <td>Returns 1.0 if a is 0.0 Else returns 0.0<br>
not(0.3) returns 0.0</td> not(0.3) returns 0.0</td>
</tr> </tr>
<tr> <tr>
<td>for(init,test,inc,a1,...)</td> <td>for(init,test,inc,a1,...)</td>
<td>4</td> <td>4</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>This function acts like a for loop in C. First init is <td>This function acts like a for loop in C. First init is
evaluated. Then test is evaluated. As long as the evaluated. Then test is evaluated. As long as the
test is not 0.0, the action statements (a1 to an) are test is not 0.0, the action statements (a1 to an) are
evaluated, the inc statement is evaluated, and the test evaluated, the inc statement is evaluated, and the test
is evaluated again. The result is the result of the is evaluated again. The result is the result of the
final action statement.<br> final action statement.<br>
for(x=0,below(x,11),x=x+1,y=y+x) returns 55.0 (if y was for(x=0,below(x,11),x=x+1,y=y+x) returns 55.0 (if y was
initially 0.0)</td> initially 0.0)</td>
</tr> </tr>
<tr> <tr>
<td>many(expr,...)</td> <td>many(expr,...)</td>
<td>1</td> <td>1</td>
<td>None</td> <td>None</td>
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td>This function treats many subexpressions as a single object <td>This function treats many subexpressions as a single object
(function). It is mainly for the 'for' function.<br> (function). It is mainly for the 'for' function.<br>
for(many(j=5,k=1),above(j*k,0.001),many(j=j+5,k=k/2),0)</td> for(many(j=5,k=1),above(j*k,0.001),many(j=j+5,k=k/2),0)</td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="InternalConst">ExprEval Internal Constants</a></h2> <h2><a name="InternalConst">ExprEval Internal Constants</a></h2>
<blockquote> <blockquote>
The following constants are provided with ExprEval: The following constants are provided with ExprEval:
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Constant</b></td> <td align="center"><b>Constant</b></td>
<td align="center"><b>Math Form</b></td> <td align="center"><b>Math Form</b></td>
<td align="center"><b>Value</b></td> <td align="center"><b>Value</b></td>
</tr> </tr>
<tr> <tr>
<td>M_E</td> <td>M_E</td>
<td>e</td> <td>e</td>
<td>2.7182818284590452354</td> <td>2.7182818284590452354</td>
</tr> </tr>
<tr> <tr>
<td>M_LOG2E</td> <td>M_LOG2E</td>
<td>log<sub>2</sub>(e)</td> <td>log<sub>2</sub>(e)</td>
<td>1.4426950408889634074</td> <td>1.4426950408889634074</td>
</tr> </tr>
<tr> <tr>
<td>M_LOG10E</td> <td>M_LOG10E</td>
<td>log<sub>10</sub>(e)</td> <td>log<sub>10</sub>(e)</td>
<td>0.43429448190325182765</td> <td>0.43429448190325182765</td>
</tr> </tr>
<tr> <tr>
<td>M_LN2</td> <td>M_LN2</td>
<td>ln(2)</td> <td>ln(2)</td>
<td>0.69314718055994530942</td> <td>0.69314718055994530942</td>
</tr> </tr>
<tr> <tr>
<td>M_LN10</td> <td>M_LN10</td>
<td>ln(10)</td> <td>ln(10)</td>
<td>2.30258509299404568402</td> <td>2.30258509299404568402</td>
</tr> </tr>
<tr> <tr>
<td>M_PI</td> <td>M_PI</td>
<td>&#960;</td> <td>&#960;</td>
<td>3.14159265358979323846</td> <td>3.14159265358979323846</td>
</tr> </tr>
<tr> <tr>
<td>M_PI_2</td> <td>M_PI_2</td>
<td>&#960;/2</td> <td>&#960;/2</td>
<td>1.57079632679489661923</td> <td>1.57079632679489661923</td>
</tr> </tr>
<tr> <tr>
<td>M_PI_4</td> <td>M_PI_4</td>
<td>&#960;/4</td> <td>&#960;/4</td>
<td>0.78539816339744830962</td> <td>0.78539816339744830962</td>
</tr> </tr>
<tr> <tr>
<td>M_1_PI</td> <td>M_1_PI</td>
<td>1/&#960;</td> <td>1/&#960;</td>
<td>0.31830988618379067154</td> <td>0.31830988618379067154</td>
</tr> </tr>
<tr> <tr>
<td>M_2_PI</td> <td>M_2_PI</td>
<td>2/&#960;</td> <td>2/&#960;</td>
<td>0.63661977236758134308</td> <td>0.63661977236758134308</td>
</tr> </tr>
<tr> <tr>
<td>M_1_SQRTPI</td> <td>M_1_SQRTPI</td>
<td>1/&#8730;(&#960;)</td> <td>1/&#8730;(&#960;)</td>
<td>0.56418958354776</td> <td>0.56418958354776</td>
</tr> </tr>
<tr> <tr>
<td>M_2_SQRTPI</td> <td>M_2_SQRTPI</td>
<td>2/&#8730;(&#960;)</td> <td>2/&#8730;(&#960;)</td>
<td>1.12837916709551257390</td> <td>1.12837916709551257390</td>
</tr> </tr>
<tr> <tr>
<td>M_SQRT2</td> <td>M_SQRT2</td>
<td>&#8730;(2)</td> <td>&#8730;(2)</td>
<td>1.41421356237309504880</td> <td>1.41421356237309504880</td>
</tr> </tr>
<tr> <tr>
<td>M_1_SQRT2</td> <td>M_1_SQRT2</td>
<td>1/&#8730;(2)</td> <td>1/&#8730;(2)</td>
<td>0.70710678118654752440</td> <td>0.70710678118654752440</td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="AppFunc">Application Internal Functions</a></h2> <h2><a name="AppFunc">Application Internal Functions</a></h2>
<blockquote> <blockquote>
Application defined expression functions go here. Application defined expression functions go here.
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Function</b></td> <td align="center"><b>Function</b></td>
<td align="center"><b>Min. Args</b></td> <td align="center"><b>Min. Args</b></td>
<td align="center"><b>Max. Args</b></td> <td align="center"><b>Max. Args</b></td>
<td align="center"><b>Min. Ref Args</b></td> <td align="center"><b>Min. Ref Args</b></td>
<td align="center"><b>Max. Ref Args</b></td> <td align="center"><b>Max. Ref Args</b></td>
<td align="center"><b>Result/Comment</b></td> <td align="center"><b>Result/Comment</b></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="AppConst">Application Internal Constants</a></h2> <h2><a name="AppConst">Application Internal Constants</a></h2>
<blockquote> <blockquote>
Application defined expression constants go here. Application defined expression constants go here.
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Constant</b></td> <td align="center"><b>Constant</b></td>
<td align="center"><b>Math Form</b></td> <td align="center"><b>Math Form</b></td>
<td align="center"><b>Value</b></td> <td align="center"><b>Value</b></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
<div align="left" class="container"> <div align="left" class="container">
<h2><a name="AppVar">Application Internal Variables</a></h2> <h2><a name="AppVar">Application Internal Variables</a></h2>
<blockquote> <blockquote>
Application defined expression variables go here. Application defined expression variables go here.
<table align="center" border="1" width="75%"> <table align="center" border="1" width="75%">
<tr> <tr>
<td align="center"><b>Variable</b></td> <td align="center"><b>Variable</b></td>
<td align="center"><b>Math Form</b></td> <td align="center"><b>Math Form</b></td>
<td align="center"><b>Value</b></td> <td align="center"><b>Value</b></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
</tr> </tr>
</table> </table>
</blockquote> </blockquote>
</div> </div>
</body> </body>
</html> </html>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论