11 - 379 11 - 379
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
SIN
Function
SINe
• Returns the trigonometric sine function of a value.
SIN(<numeric expression>)
Syntax
numeric expression
• • • •
Specify a value or numeric variable in radians.
Examples
A=SIN(3.14159/180*60)
• • • •
Converts the angle of 60( into radians, calculates the
sine value, and assigns it to A.
Description
• The SIN function returns the sine function value of <numeric expression>, which must be
given in radians (
π
/180 x angle).
• <numeric expression> can be any type of value, but the SIN function always calculates the
result in single-precision.
Program Example
10 ' This program returns sin 45°
20 A=(3.141592653#*45)/180
:
' Converts 45° to radian
30 B=SIN(A)
:
' Obtains sin 45°
40 PRINT "45°=";A;"radians"
50 PRINT "sin 45°=";B
60 END
RUN
45°=.785398 radians
sin 45°= .707107
OK
REMARK
See the COS and TAN functions.