Click or drag to resize

MathfAtan2 Method

Returns the arc tangent of `y` and `x` in radians. Use to get the angle of the tangent of `y/x`. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. Important note: The Y coordinate comes first, by convention.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static float Atan2(
	float y,
	float x
)

Parameters

y
Type: SystemSingle
The Y coordinate of the point to find the angle to.
x
Type: SystemSingle
The X coordinate of the point to find the angle to.

Return Value

Type: Single
An angle that would result in the given tangent value. On the range `-Tau/2` to `Tau/2`.
See Also