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

IN

ANY_REAL

Angle in radians.

Outputs

Name

Type

Description

Return value

ANY_REAL

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

  • SIN — sine

  • COS — cosine

  • ATAN — arc tangent

References