This function will calculate the arc sine of an angle.
Note: This function works with DOUBLE, but can also work with FLOAT as described in the Floating-point math introductory section.
Input:
V : DOUBLE (-1 .. +1)
Value to compute the arc sine of.
Returns: DOUBLE
The arc sine of the angle in radians. If V is invalid, NaN is returned.
Declaration:
FUNCTION asin : DOUBLE;
VAR_INPUT
v : DOUBLE;
END_VAR;
Example:
INCLUDE rtcu.inc
INCLUDE math.inc
PROGRAM test;
VAR
a : DOUBLE;
END_VAR;
a := cos(v:=0.4);
DebugMsg(message:=" cos " + doubleToStr(v := a));
DebugMsg(message:="acos " + doubleToStr(v := acos(v:=a)));
a := sin(v:=0.4);
DebugMsg(message:=" sin " + doubleToStr(v := a));
DebugMsg(message:="asin " + doubleToStr(v := asin(v:=a)));
a := tan(v:=0.4);
DebugMsg(message:=" tan " + doubleToStr(v := a));
DebugMsg(message:="atan " + doubleToStr(v := atan(v:=a)));
a := atan2(a:=10.0, b:= 10.0);
DebugMsg(message:="atan2 " + doubleToStr(v := a));
END_PROGRAM;
|