docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method unlerp

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

    Declaration
    public static float unlerp(float a, float b, float x)
    Parameters
    Type Name Description
    float a

    The first endpoint of the range.

    float b

    The second endpoint of the range.

    float x

    The value to normalize to the range.

    Returns
    Type Description
    float

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

    Declaration
    public static float2 unlerp(float2 a, float2 b, float2 x)
    Parameters
    Type Name Description
    float2 a

    The first endpoint of the range.

    float2 b

    The second endpoint of the range.

    float2 x

    The value to normalize to the range.

    Returns
    Type Description
    float2

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

    Declaration
    public static float3 unlerp(float3 a, float3 b, float3 x)
    Parameters
    Type Name Description
    float3 a

    The first endpoint of the range.

    float3 b

    The second endpoint of the range.

    float3 x

    The value to normalize to the range.

    Returns
    Type Description
    float3

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

    Declaration
    public static float4 unlerp(float4 a, float4 b, float4 x)
    Parameters
    Type Name Description
    float4 a

    The first endpoint of the range.

    float4 b

    The second endpoint of the range.

    float4 x

    The value to normalize to the range.

    Returns
    Type Description
    float4

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

    Declaration
    public static double unlerp(double a, double b, double x)
    Parameters
    Type Name Description
    double a

    The first endpoint of the range.

    double b

    The second endpoint of the range.

    double x

    The value to normalize to the range.

    Returns
    Type Description
    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).

    Declaration
    public static double2 unlerp(double2 a, double2 b, double2 x)
    Parameters
    Type Name Description
    double2 a

    The first endpoint of the range.

    double2 b

    The second endpoint of the range.

    double2 x

    The value to normalize to the range.

    Returns
    Type Description
    double2

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

    Declaration
    public static double3 unlerp(double3 a, double3 b, double3 x)
    Parameters
    Type Name Description
    double3 a

    The first endpoint of the range.

    double3 b

    The second endpoint of the range.

    double3 x

    The value to normalize to the range.

    Returns
    Type Description
    double3

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

    Declaration
    public static double4 unlerp(double4 a, double4 b, double4 x)
    Parameters
    Type Name Description
    double4 a

    The first endpoint of the range.

    double4 b

    The second endpoint of the range.

    double4 x

    The value to normalize to the range.

    Returns
    Type Description
    double4

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

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)