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

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

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

```csharp
public static float unlerp(float start, float end, float x)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The start point of the range.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The end point of the range.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The value to normalize to the range.

### Returns

| Type                                                          | Description                                                               |
| ------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The 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).

```csharp
public static float2 unlerp(float2 start, float2 end, float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): The start point of the range.**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): The end point of the range.**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): The value to normalize to the range.

### Returns

| Type                                                                  | Description                                                                             |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [float2](/engine/6000.6/script-reference/unity/mathematics/float2.md) | The 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).

```csharp
public static float3 unlerp(float3 start, float3 end, float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The start point of the range.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The end point of the range.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The value to normalize to the range.

### Returns

| Type                                                                  | Description                                                                             |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | The 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).

```csharp
public static float4 unlerp(float4 start, float4 end, float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.6/script-reference/unity/mathematics/float4)): The start point of the range.**** (\[float4]\(/engine/6000.6/script-reference/unity/mathematics/float4)): The end point of the range.**** (\[float4]\(/engine/6000.6/script-reference/unity/mathematics/float4)): The value to normalize to the range.

### Returns

| Type                                                                  | Description                                                                             |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [float4](/engine/6000.6/script-reference/unity/mathematics/float4.md) | The 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).

```csharp
public static double unlerp(double start, double end, double x)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): The start point of the range.**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): The end point of the range.**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): The value to normalize to the range.

### Returns

| Type                                                           | Description                                                               |
| -------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The 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).

```csharp
public static double2 unlerp(double2 start, double2 end, double2 x)
```

### Parameters

**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): The start point of the range.**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): The end point of the range.**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): The value to normalize to the range.

### Returns

| Type                                                                    | Description                                                                             |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [double2](/engine/6000.6/script-reference/unity/mathematics/double2.md) | The 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).

```csharp
public static double3 unlerp(double3 start, double3 end, double3 x)
```

### Parameters

**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): The start point of the range.**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): The end point of the range.**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): The value to normalize to the range.

### Returns

| Type                                                                    | Description                                                                             |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [double3](/engine/6000.6/script-reference/unity/mathematics/double3.md) | The 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).

```csharp
public static double4 unlerp(double4 start, double4 end, double4 x)
```

### Parameters

**** (\[double4]\(/engine/6000.6/script-reference/unity/mathematics/double4)): The start point of the range.**** (\[double4]\(/engine/6000.6/script-reference/unity/mathematics/double4)): The end point of the range.**** (\[double4]\(/engine/6000.6/script-reference/unity/mathematics/double4)): The value to normalize to the range.

### Returns

| Type                                                                    | Description                                                                             |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [double4](/engine/6000.6/script-reference/unity/mathematics/double4.md) | The componentwise interpolation parameter of x with respect to the input range \[a, b]. |
