11 - 5 11 - 5
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
ATN
Function
TaNgent
• Returns arc tangent (tan
-1
) of the arithmetic expression.
ATN ( <arithmetic expression> )
Syntax
arithmetic expression
• • • •
Specify an arithmetic expression to calculate the arc
tangent.
Examples
A=(180/3.141592)
ATN(1)
• • • •
Calculates the arc tangent of 1, then converts to
degrees and assigns it to A.
Description
• The ATN function returns the arc tangent (tan
-1
) of the value from the <arithmetic
expression>.
• While <arithmetic expression> can be any value type, the ATN function always calculates
in single precision.
• Unit of the returned value is in radian.
Program Example
10 ' Calculates angle by the ATN function
20 HI=1732/1000
:
' Defines the value
30 RAD=ATN(HI)
:
' Calculates the angle
40 DEG=(RAD*180)/3.141592653#
:
' Converts the value in radian to degrees
50 PRINT "RAD.=";RAD
:
' Display
60 PRINT "DEG.=";DEG
70 END
RUN
RAD.= 1.04719
DEG.= 59.9993
OK
REMARK
See the COS, SIN and TAN functions.