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 @ 43983
History | View | Annotate | Download (776 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 | "Double"
|
||
18 | 43512 | jjdelcerro | ); |
19 | } |
||
20 | |||
21 | @Override
|
||
22 | 43521 | jjdelcerro | public Object call(Interpreter interpreter, Object[] args) { |
23 | 43512 | jjdelcerro | double r = Math.acos(getDouble(args, 0)); |
24 | return r;
|
||
25 | } |
||
26 | |||
27 | } |