atan2()

Math / Trigonometry

Description

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

NameTypeDescription
yfloaty-coordinate
xfloatx-coordinate

Returns

float

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...