Atn2
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Return the inverse tangent (arctan) of a tangent value a/b. The inverse tangent is the angle measured in radians from the positive x-axis to a line whose endpoints are the origin and the Cartesian coordinates (b, a).
Syntax
Atn2(x, y)
Arguments
-
x
An integer or real number
-
y
A non-zero integer or real number
Returns
The inverse tangent in radians of the tangent value x/y
Exceptions
Returns an error if x or y is not an integer or real number
Example
Atn2(1,2)
-
[Returns 0.46365]
Atn2('att1', 'att2')
-
[Return the inverse tangent in radians of the tangent value 'att1'/'att2' at trigger time]
Atn2(TagVal('att1','y+8h'), TagVal('att2', 'y+8h'))
-
[Return the inverse tangent in radians of the tangent value 'att1'/'att2' at 8am yesterday]