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 / ATanFunction.java @ 43983
History | View | Annotate | Download (1.06 KB)
1 |
package org.gvsig.expressionevaluator.impl.function.numeric; |
---|---|
2 |
|
3 |
import org.apache.commons.lang3.Range; |
4 |
import org.gvsig.expressionevaluator.Interpreter; |
5 |
import org.gvsig.expressionevaluator.spi.AbstractFunction; |
6 |
|
7 |
public class ATanFunction extends AbstractFunction { |
8 |
|
9 |
public ATanFunction() {
|
10 |
super("Numeric", "ATAN", Range.is(1), |
11 |
"Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2. Special cases:\n" +
|
12 |
"- If the argument is NaN, then the result is NaN.\n" +
|
13 |
"- If the argument is zero, then the result is a zero with the same sign as the argument.\n" +
|
14 |
"The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.\n",
|
15 |
"ATAN({{a}})",
|
16 |
new String[]{ |
17 |
"a - the value whose arc tangent is to be returned."
|
18 |
}, |
19 |
"Double"
|
20 |
); |
21 |
} |
22 |
|
23 |
@Override
|
24 |
public Object call(Interpreter interpreter, Object[] args) { |
25 |
double r = Math.atan(getDouble(args, 0)); |
26 |
return r;
|
27 |
} |
28 |
|
29 |
} |