iDevOS CALC "ATAN2" Command
Get the "two argument" arc (inverse) tangent.
Description
CALC( y, a, b, "ATAN2" ); // y = atan2(a, b) = arc tangent of a and b
This command returns the angle y
as the arc tangent (or inverse tangent) of a
and b
.
The angle y
by default is specified in Degrees. Angles used in trigonometric functions can be set globally to use Radians by the SYSTEM.angles
property.
Note: The values passed into the trigonometric function (a
and b
) must not be 0
otherwise a system error will be generated. It is the responsibility of the user to check this.
Trigonometric functions: "COS"
, "SIN"
, "TAN"
, "ACOS"
, "ASIN"
, "ATAN"
, "ATAN2"
, "COSH"
, "SINH"
, "TANH"
, "ACOSH"
, "ASINH"
, "ATANH"
.
Parameters
y
- Calculation result.
Parameter type: entity name of a numeric variable (egU8
,S32
,FLT3
etc). a
andb
- Input values.
Parameter type: immediate number, or entity name of a numeric variable (egU8
,S32
,FLT3
etc). "ATAN2"
- CALC command operator.
Parameter type: immediate string.
Examples
Example 1
VAR(df, 0.0, FLT4); // result VAR(af, 3.5355, FLT4); // value VAR(bf, 5, FLT4); // divider CALC(df, af, bf, "ATAN2" ); // df = 35.2641