Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


lengthsq

Returns the squared length of a float value. Equivalent to squaring the value.
Read time 2 minutesLast updated 11 days ago

Definition

lengthsq(float)

Returns the squared length of a float value. Equivalent to squaring the value.
public static float lengthsq(float x)

Parameters

Value to use when computing squared length.

Returns

Type

Description

floatSquared length of x.

lengthsq(float2)

Returns the squared length of a float2 vector.
public static float lengthsq(float2 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

floatSquared length of vector x.

lengthsq(float3)

Returns the squared length of a float3 vector.
public static float lengthsq(float3 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

floatSquared length of vector x.

lengthsq(float4)

Returns the squared length of a float4 vector.
public static float lengthsq(float4 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

floatSquared length of vector x.

lengthsq(double)

Returns the squared length of a double value. Equivalent to squaring the value.
public static double lengthsq(double x)

Parameters

Value to use when computing squared length.

Returns

Type

Description

doubleSquared length of x.

lengthsq(double2)

Returns the squared length of a double2 vector.
public static double lengthsq(double2 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

lengthsq(double3)

Returns the squared length of a double3 vector.
public static double lengthsq(double3 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

lengthsq(double4)

Returns the squared length of a double4 vector.
public static double lengthsq(double4 x)

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

lengthsq(quaternion)

Returns the squared length of a quaternion.
public static float lengthsq(quaternion q)

Parameters

The input quaternion.

Returns

Type

Description

floatThe length squared of the input quaternion.