Trigonometric operators, Trigonometric operators -8, Sin([expr]) – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 30: Cos([expr]), Tan([expr]), Atn([expr])

Advertising
background image

Publication 1746-RM001A-US-P

3-8 Expressions and Operators

Trigonometric Operators

The module contains a complete set of trigonometric operators. These operators
are single-operand operators.

SIN([expr])

Use the SIN operator to return the sine of the argument. The argument is
expressed in radians. Calculations are carried out to 7 significant digits. The
argument must be between +200000.

COS([expr])

Use the COS operator to return the cosine of the argument. The argument is
expressed in radians. Calculations are carried out to 7 significant digits. The
argument must be between +200000.

TAN([expr])

Use the TAN operator to return the tangent of the argument. The argument is
expressed in radians. The argument must be between +200000.

ATN([expr])

Use the ATN operator to return the arctangent of the argument. The result is in
radians. Calculations are carried out to 7 significant digits. The ATN operator
returns a result between –PI/2 (3.1415926/2) and PI/2.

Example

Result

>PRINT SIN(PI/4)

.7071067

>PRINT SIN(0)

0

Example

Result

>PRINT COS(PI/4)

.7071067

>PRINT COS(0)

1

Example

Result

>PRINT TAN(PI/4)

1

>PRINT TAN(0)

0

Example

Result

>PRINT ATN(PI)

1.2626272

>PRINT ATN(1)

.78539804

Advertising