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 / ASinFunction.java @ 43989
History | View | Annotate | Download (1.11 KB)
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 ASinFunction extends AbstractFunction { |
||
8 | |||
9 | public ASinFunction() {
|
||
10 | 43983 | jjdelcerro | super("Numeric", "ASIN", Range.is(1), |
11 | "Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2. Special cases:\n" +
|
||
12 | "- If the argument is NaN or its absolute value is greater than 1, 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.",
|
||
15 | "ASIN({{a}})",
|
||
16 | new String[]{ |
||
17 | "a - the value whose arc sine is to be returned"
|
||
18 | }, |
||
19 | 43989 | jjdelcerro | "Double",
|
20 | true
|
||
21 | 43983 | jjdelcerro | ); |
22 | 43512 | jjdelcerro | } |
23 | |||
24 | @Override
|
||
25 | 43521 | jjdelcerro | public Object call(Interpreter interpreter, Object[] args) { |
26 | 43512 | jjdelcerro | double r = Math.asin(getDouble(args, 0)); |
27 | return r;
|
||
28 | } |
||
29 | |||
30 | } |