Download 2 Overview - Inductive Automation

Transcript
Appendix B. Expression Functions
438
8.5.10 round
round(number, [decimals])
Rounds a floating point number. If the decimals argument is omitted, then the number is rounded to
the nearest integer value, and the result will be a long (64-bit integer).
If a number of decimal places are specified, the result will be a double (64-bit floating point value), and
the result will be rounded to the given number of decimal places.
round(3.829839, 2)
... returns 3.83
8.5.11 sin
sin(number)
Returns the trigonometric sine of number, which is interpreted as an angle expressed in radians. The
results will be a floating point value.
sin(1.89)
... returns 0.9495
8.5.12 sqrt
sqrt(number)
Returns the square root of the argument number.
sqrt(64)
... returns 8.0
8.5.13 tan
tan(number)
Returns the trigonometric tangent of number, which is interpreted as an angle expressed in radians.
The results will be a floating point value.
tan(1.89)
... returns -3.026
8.5.14 todegrees
todegrees(number)
Converts an angle measured in radians to an equivalent angle measured in degrees.
toDegrees(3.14)
... returns 179.9088
8.5.15 toradians
toradians(number)
Converts an angle measured in degrees to an equivalent angle measured in radians.
© 2011 Inductive Automation