TAN¶
Returns the tangent of an angle in radians.
Signature¶
┌─────────┐
IN ─┤ TAN ├─ OUT
└─────────┘
FUNCTION TAN : ANY_REAL
VAR_INPUT
IN : ANY_REAL;
END_VAR
END_FUNCTION
The return type matches the input type. TAN accepts REAL,
LREAL.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
Angle in radians. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
The tangent of IN. Same type as IN. |
Description¶
Returns the tangent of IN, where IN is an angle expressed in radians. The result is undefined when IN is an odd multiple of pi/2.
Example¶
result := TAN(REAL#0.0); (* result = 0.0 *)
value := TAN(LREAL#0.7853982); (* value ~ 1.0 *)
See Also¶
References¶
IEC 61131-3 §2.5.1.5.2