docs.unity.cn
    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 start, float end, float x)
    Parameters
    Type Name Description
    Single start

    The start point of the range.

    Single end

    The end point 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 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].

    Back to top
    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