Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.atan2

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static float atan2(float y, float x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

float The arctangent of the ratio y/x, in radians.

Description

Returns the 2-argument arctangent of a pair of float values.


Declaration

public static float2 atan2(float2 y, float2 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

float2 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the componentwise 2-argument arctangent of a pair of floats2 vectors.


Declaration

public static float3 atan2(float3 y, float3 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

float3 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the componentwise 2-argument arctangent of a pair of floats3 vectors.


Declaration

public static float4 atan2(float4 y, float4 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

float4 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the componentwise 2-argument arctangent of a pair of floats4 vectors.


Declaration

public static double atan2(double y, double x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

double The arctangent of the ratio y/x, in radians.

Description

Returns the 2-argument arctangent of a pair of double values.


Declaration

public static double2 atan2(double2 y, double2 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

double2 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the 2-argument arctangent of a pair of double2 vectors.


Declaration

public static double3 atan2(double3 y, double3 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

double3 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the 2-argument arctangent of a pair of double3 vectors.


Declaration

public static double4 atan2(double4 y, double4 x);

Parameters

Parameter Description
y Numerator of the ratio y/x, usually the y component on the unit circle.
x Denominator of the ratio y/x, usually the x component on the unit circle.

Returns

double4 The componentwise arctangent of the ratio y/x, in radians.

Description

Returns the 2-argument arctangent of a pair of double4 vectors.