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

math.lengthsq

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 lengthsq(float x);

Parameters

Parameter Description
x Value to use when computing squared length.

Returns

float Squared length of x.

Description

Returns the squared length of a float value. Equivalent to squaring the value.


Declaration

public static float lengthsq(float2 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

float Squared length of vector x.

Description

Returns the squared length of a float2 vector.


Declaration

public static float lengthsq(float3 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

float Squared length of vector x.

Description

Returns the squared length of a float3 vector.


Declaration

public static float lengthsq(float4 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

float Squared length of vector x.

Description

Returns the squared length of a float4 vector.


Declaration

public static double lengthsq(double x);

Parameters

Parameter Description
x Value to use when computing squared length.

Returns

double Squared length of x.

Description

Returns the squared length of a double value. Equivalent to squaring the value.


Declaration

public static double lengthsq(double2 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

double Squared length of vector x.

Description

Returns the squared length of a double2 vector.


Declaration

public static double lengthsq(double3 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

double Squared length of vector x.

Description

Returns the squared length of a double3 vector.


Declaration

public static double lengthsq(double4 x);

Parameters

Parameter Description
x Vector to use when computing squared length.

Returns

double Squared length of vector x.

Description

Returns the squared length of a double4 vector.


Declaration

public static float lengthsq(quaternion q);

Parameters

Parameter Description
q The input quaternion.

Returns

float The length squared of the input quaternion.

Description

Returns the squared length of a quaternion.