Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


length

Returns the length of a float value. Equivalent to the absolute value.
Read time 2 minutesLast updated 6 days ago

Definition

length(float)

Returns the length of a float value. Equivalent to the absolute value.
public static float length(float x)

Parameters

Value to use when computing length.

Returns

Type

Description

floatLength of x.

length(float2)

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

Parameters

Vector to use when computing length.

Returns

Type

Description

floatLength of vector x.

length(float3)

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

Parameters

Vector to use when computing length.

Returns

Type

Description

floatLength of vector x.

length(float4)

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

Parameters

Vector to use when computing length.

Returns

Type

Description

floatLength of vector x.

length(double)

Returns the length of a double value. Equivalent to the absolute value.
public static double length(double x)

Parameters

Value to use when computing squared length.

Returns

Type

Description

doubleSquared length of x.

length(double2)

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

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

length(double3)

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

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

length(double4)

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

Parameters

Vector to use when computing squared length.

Returns

Type

Description

doubleSquared length of vector x.

length(quaternion)

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

Parameters

The input quaternion.

Returns

Type

Description

floatThe length of the input quaternion.