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

math.unlerp

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 unlerp(float start, float end, float x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static float2 unlerp(float2 start, float2 end, float2 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static float3 unlerp(float3 start, float3 end, float3 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static float4 unlerp(float4 start, float4 end, float4 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static double unlerp(double start, double end, double x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static double2 unlerp(double2 start, double2 end, double2 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static double3 unlerp(double3 start, double3 end, double3 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).


Declaration

public static double4 unlerp(double4 start, double4 end, double4 x);

Parameters

Parameter Description
start The start point of the range.
end The end point of the range.
x The value to normalize to the range.

Returns

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

Description

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).