[Pixelle-commit] SF.net SVN: pixelle: [111] trunk/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-28 23:57:08
|
Revision: 111
http://pixelle.svn.sourceforge.net/pixelle/?rev=111&view=rev
Author: dbrosius
Date: 2008-06-28 16:57:09 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add most of the java.lang.Math functions
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-28 23:18:02 UTC (rev 110)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-28 23:57:09 UTC (rev 111)
@@ -265,6 +265,50 @@
| 'min' '(' expr ',' expr ')'
{
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "min", "(DD)D");
+ }
+ | 'pow' '(' expr ',' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "pow", "(DD)D");
+ }
+ | 'sqrt' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "sqrt", "(D)D");
+ }
+ | 'sin' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "sin", "(D)D");
+ }
+ | 'cos' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "cos", "(D)D");
+ }
+ | 'tan' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "tan", "(D)D");
+ }
+ | 'asin' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "asin", "(D)D");
+ }
+ | 'acos' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "acos", "(D)D");
+ }
+ | 'atan' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "atan", "(D)D");
+ }
+ | 'log' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "log", "(D)D");
+ }
+ | 'exp' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "exp", "(D)D");
+ }
+ | 'random'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "random", "()D");
} ;
NUMBER : '0'..'9'+ ( '.' ('0'..'9'+))?;
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-28 23:18:02 UTC (rev 110)
+++ trunk/pixelle/htdocs/index.html 2008-06-28 23:57:09 UTC (rev 111)
@@ -49,11 +49,33 @@
<li>height<br/>
The height in pixels of the image.</li>
<li>abs(e)<br/>
- The absolute value of an expression.
+ The absolute value of an expression.</li>
<li>min(e, f)<br/>
- The minimum value of two expressions.
+ The minimum value of two expressions.</li>
<li>min(e, f)<br/>
- The maximum value of two expressions.
+ The maximum value of two expressions.</li>
+ <li>pow(e, f)<br/>
+ One expression raised to the second expression's power</li>
+ <li>sqrt(e)<br/>
+ The square root of an expression</li>
+ <li>sin(e)<br/>
+ The sine of an expression</li>
+ <li>cos(e)<br/>
+ The cosine of an expression</li>
+ <li>tan(e)<br/>
+ The tangent of an expression</li>
+ <li>asin(e)<br/>
+ The arc sine of an expression</li>
+ <li>acos(e)<br/>
+ The arc cosine of an expression</li>
+ <li>atan(e)<br/>
+ The arc tangent of an expression</li>
+ <li>log(e)<br/>
+ The log of an expression</li>
+ <li>exp(e)<br/>
+ The euler number (e) raised to an expression's power.</li>
+ <li>random(e)<br/>
+ A random number between 0 and 1</li>
</ul>
<p><pre>As of June 27, simple expressions should work. Some examples:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|