ATAN2
Function that calculates the arc tangent from given X and Y values in a user specified format.
Parameters:
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_INPUT | ||||
| B | EN | BOOL | This function will continue to calculate the ATAN2 result while EN is held high. | FALSE |
| V | X | LREAL | X coordinate | LREAL#0.0 |
| V | Y | LREAL | Y coordinate | LREAL#0.0 |
| V | Output_Format | Yt_MA_ATAN2OutputType | Format of the output value. | INT#0 |
| 0: radians (-pi, pi] | ||||
| 1: radians [0, 2*pi) | ||||
| 2: degrees [0°, 360°) | ||||
| VAR_OUTPUT | ||||
| B | ENO | BOOL | High if the function is executing normally. | |
Notes:
- Output is an LREAL.
- The ATAN2 function is useful in many applications involving vectors, such as finding the direction from one point to another. This two argument function is a variation of the ATAN function. For any LREAL arguments x and y, atan2(y, x) is the angle between the positive x-axis of a plane and the point given by the coordinates (x, y) on it.
- Datatype Yt_MA_ATAN2OutputType is defined but not always used.