svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / function / numeric / ACosFunction.java @ 44207
History | View | Annotate | Download (884 Bytes)
1 | 43512 | jjdelcerro | package org.gvsig.expressionevaluator.impl.function.numeric; |
---|---|---|---|
2 | |||
3 | import org.apache.commons.lang3.Range; |
||
4 | 43521 | jjdelcerro | import org.gvsig.expressionevaluator.Interpreter; |
5 | 43512 | jjdelcerro | import org.gvsig.expressionevaluator.spi.AbstractFunction; |
6 | |||
7 | public class ACosFunction extends AbstractFunction { |
||
8 | |||
9 | public ACosFunction() {
|
||
10 | super(
|
||
11 | "Numeric", "ACOS", Range.is(1), |
||
12 | "Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.",
|
||
13 | 43983 | jjdelcerro | "ACOS({{a}})",
|
14 | 43512 | jjdelcerro | new String[]{ |
15 | "value whose arc tangent is to be returned"
|
||
16 | 43983 | jjdelcerro | }, |
17 | 43989 | jjdelcerro | "Double",
|
18 | true
|
||
19 | 43512 | jjdelcerro | ); |
20 | } |
||
21 | |||
22 | @Override
|
||
23 | 44009 | jjdelcerro | public boolean allowConstantFolding() { |
24 | return true; |
||
25 | } |
||
26 | |||
27 | @Override
|
||
28 | 43521 | jjdelcerro | public Object call(Interpreter interpreter, Object[] args) { |
29 | 43512 | jjdelcerro | double r = Math.acos(getDouble(args, 0)); |
30 | return r;
|
||
31 | } |
||
32 | |||
33 | } |