Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


unlerp

Returns the result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
Read time 3 minutesLast updated 4 days ago

Definition

unlerp(float, float, float)

Returns the result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static float unlerp(float start, float end, float x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

floatThe interpolation parameter of x with respect to the input range [a, b].

unlerp(float2, float2, float2)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static float2 unlerp(float2 start, float2 end, float2 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

float2The componentwise interpolation parameter of x with respect to the input range [a, b].

unlerp(float3, float3, float3)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static float3 unlerp(float3 start, float3 end, float3 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

float3The componentwise interpolation parameter of x with respect to the input range [a, b].

unlerp(float4, float4, float4)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static float4 unlerp(float4 start, float4 end, float4 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

float4The componentwise interpolation parameter of x with respect to the input range [a, b].

unlerp(double, double, double)

Returns the result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static double unlerp(double start, double end, double x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

doubleThe interpolation parameter of x with respect to the input range [a, b].

unlerp(double2, double2, double2)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static double2 unlerp(double2 start, double2 end, double2 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

double2The componentwise interpolation parameter of x with respect to the input range [a, b].

unlerp(double3, double3, double3)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static double3 unlerp(double3 start, double3 end, double3 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

double3The componentwise interpolation parameter of x with respect to the input range [a, b].

unlerp(double4, double4, double4)

Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a).
public static double4 unlerp(double4 start, double4 end, double4 x)

Parameters

start

The start point of the range.

The end point of the range.

The value to normalize to the range.

Returns

Type

Description

double4The componentwise interpolation parameter of x with respect to the input range [a, b].