Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


atan2

Returns the 2-argument arctangent of a pair of float values.
Read time 3 minutesLast updated 11 days ago

Definition

atan2(float, float)

Returns the 2-argument arctangent of a pair of float values.
public static float atan2(float y, float x)

Parameters

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

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

Returns

Type

Description

floatThe arctangent of the ratio y/x, in radians.

atan2(float2, float2)

Returns the componentwise 2-argument arctangent of a pair of floats2 vectors.
public static float2 atan2(float2 y, float2 x)

Parameters

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

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

Returns

Type

Description

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

atan2(float3, float3)

Returns the componentwise 2-argument arctangent of a pair of floats3 vectors.
public static float3 atan2(float3 y, float3 x)

Parameters

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

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

Returns

Type

Description

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

atan2(float4, float4)

Returns the componentwise 2-argument arctangent of a pair of floats4 vectors.
public static float4 atan2(float4 y, float4 x)

Parameters

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

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

Returns

Type

Description

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

atan2(double, double)

Returns the 2-argument arctangent of a pair of double values.
public static double atan2(double y, double x)

Parameters

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

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

Returns

Type

Description

doubleThe arctangent of the ratio y/x, in radians.

atan2(double2, double2)

Returns the 2-argument arctangent of a pair of double2 vectors.
public static double2 atan2(double2 y, double2 x)

Parameters

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

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

Returns

Type

Description

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

atan2(double3, double3)

Returns the 2-argument arctangent of a pair of double3 vectors.
public static double3 atan2(double3 y, double3 x)

Parameters

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

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

Returns

Type

Description

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

atan2(double4, double4)

Returns the 2-argument arctangent of a pair of double4 vectors.
public static double4 atan2(double4 y, double4 x)

Parameters

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

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

Returns

Type

Description

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