docs.unity3d.com
    Show / Hide Table of Contents

    Method unlerp

    unlerp(Single, Single, Single)

    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
    Single a

    The first endpoint of the range.

    Single b

    The second endpoint of the range.

    Single x

    The value to normalize to the range.

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

    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
    • unlerp(Single, Single, Single)
    • unlerp(float2, float2, float2)
    • unlerp(float3, float3, float3)
    • unlerp(float4, float4, float4)
    • unlerp(Double, Double, Double)
    • unlerp(double2, double2, double2)
    • unlerp(double3, double3, double3)
    • unlerp(double4, double4, double4)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023