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 start, float end, float x)
    Parameters
    Type Name Description
    float start

    The start point of the range.

    float end

    The end point 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 start, float2 end, float2 x)
    Parameters
    Type Name Description
    float2 start

    The start point of the range.

    float2 end

    The end point 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 start, float3 end, float3 x)
    Parameters
    Type Name Description
    float3 start

    The start point of the range.

    float3 end

    The end point 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 start, float4 end, float4 x)
    Parameters
    Type Name Description
    float4 start

    The start point of the range.

    float4 end

    The end point 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 start, double end, double x)
    Parameters
    Type Name Description
    double start

    The start point of the range.

    double end

    The end point 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 start, double2 end, double2 x)
    Parameters
    Type Name Description
    double2 start

    The start point of the range.

    double2 end

    The end point 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 start, double3 end, double3 x)
    Parameters
    Type Name Description
    double3 start

    The start point of the range.

    double3 end

    The end point 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 start, double4 end, double4 x)
    Parameters
    Type Name Description
    double4 start

    The start point of the range.

    double4 end

    The end point 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 © 2024 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)