iDevOS CALC "TAN" Command

Get the tangent of an angle.

Description

CALC( y, a, "TAN" );      // y = tan(a)     = tangent of a
CALC( y, a, b, "TAN" );   // y = tan(a) * b = tangent of a then multiplied by b

This command returns y as the tangent of the angle a. If the multiplier value b is specified then the result is further multiplied by 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.

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 (eg U8, S32, FLT3 etc).
a and b
Input values.
Parameter type: immediate number, or entity name of a numeric variable (eg U8, S32, FLT3 etc).
"TAN"
CALC command operator.
Parameter type: immediate string.

Examples

Example 1

VAR(df, 0.0,  FLT4); // result
VAR(af, 15.0, FLT4); // angle
VAR(bf, 5,    FLT4); // multiplier

CALC(df, af, "TAN");     // df = 0.2679

CALC(df, af, bf, "TAN"); // df = 1.3977