7.4.12 ATAN2
Function
Calculate the angle between the plane coordinate point and the X-axis
LD graphics
Parameter description
floating point number
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| X | Var_Input | ANY_REAL | Operand |
| Y | Var_Input | ANY_REAL | Operand |
| Function name | Return value | ANY_REAL | Output result |
warning
- ANY_REAL: including floating point numbers (REAL, LREAL)
- The angle between the positive X-axis on the plane and the point given by the coordinates (x, y) on the plane
- For counterclockwise angles (above the X-axis, y is greater than 0), the angle is positive; for clockwise angles (below the X-axis, y is less than 0), the angle is negative
Example
- LD example is shown in the following animation:

- ST example is shown in the following code:
OUT:=ATAN2(IN1);