Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

COS

Returns the cosine of an angle in radians.

IEC 61131-3

Section 2.5.1.5.2

Support

Not yet supported

Signatures

#

Input (IN)

Return Type

Support

1

REAL

REAL

Not yet supported

2

LREAL

LREAL

Not yet supported

Description

Returns the cosine of IN, where IN is an angle expressed in radians. The result is in the range [-1.0, 1.0].

Example

result := COS(REAL#0.0);          (* result = 1.0 *)
value := COS(LREAL#3.1415927);   (* value ~ -1.0 *)

See Also

  • SIN — sine

  • TAN — tangent

  • ACOS — arc cosine