Skip to main content

7.4.12 ATAN2

Function

Calculate the angle between the plane coordinate point and the X-axis

LD graphics

Alt text

Parameter description

floating point number

Interface variableDeclarationData typeDescription
XVar_InputANY_REALOperand
YVar_InputANY_REALOperand
Function nameReturn valueANY_REALOutput 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:

alt text

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