iDevOS CALC "SIN" Command

Get the sine of an angle.

Description

CALC( y, a, "SIN" );      // y = sin(a)     = sine of a
CALC( y, a, b, "SIN" );   // y = sin(a) * b = sine of a then multiplied by b

This command returns y as the sine 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).
"SIN"
CALC command operator.
Parameter type: immediate string.

Examples

Example 1

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

CALC(df, af, "SIN");     // df = 0.7071

CALC(df, af, bf, "SIN"); // df = 3.5355