atan2()
Math / TrigonometryDescription
Calculates the angle formed by a point relative to the positive x-axis. More useful than atan for full-circle angles.
Syntax
float atan2(float y, float x)
Parameters
| Name | Type | Description |
|---|---|---|
| y | float | y-coordinate |
| x | float | x-coordinate |
Returns
floatRelated
Under the Hood
From Processing.h:
float heading() const { return std::atan2(y, x);
static float atan2(float y, float x) { return std::atan2(y,x); }
static float atan2(float y, float x) { return std::atan2(y,x);