ASin ( double value );
Description
Returns the arc sine of a value in the range from -pi/2
through pi/2
.
Input parameters
Parameter | Default value | Description |
---|---|---|
value | - | Defines argument whose arc sine is returned. Values for this argument must be in the [-1;1] range. |
Example 1
declare lower;
plot Data = Asin(0.5) == Double.Pi / 3;
Similar to the ACos
example, the code above compares two values and draws the unit (true
) plot if they are equal. If the values are not equal, the zero (false
) plot is drawn. As the arc sine of 0.5
is not equal pi/3
, the example script draws the zero plot.
Example 2
declare lower;
input length = 3;
def height = close - close[length];
def hypotenuse = Sqrt( Sqr(length) + Sqr(height) );
plot "Angle, deg" = ASin(height/hypotenuse) * 180 / Double.Pi;
The code draws a line that connects the current close
value with the close
value on the desired bar in the past. The Asin
function is used to calculate the angle of slope of the line.