docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method remap

    remap(float, float, float, float, float)

    Returns the result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static float remap(float a, float b, float c, float d, float x)
    Parameters
    Type Name Description
    float a

    The first endpoint of the source range [a,b].

    float b

    The second endpoint of the source range [a, b].

    float c

    The first endpoint of the destination range [c, d].

    float d

    The second endpoint of the destination range [c, d].

    float x

    The value to remap from the source to destination range.

    Returns
    Type Description
    float

    The remap of input x from the source range to the destination range.

    remap(float2, float2, float2, float2, float2)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static float2 remap(float2 a, float2 b, float2 c, float2 d, float2 x)
    Parameters
    Type Name Description
    float2 a

    The first endpoint of the source range [a,b].

    float2 b

    The second endpoint of the source range [a, b].

    float2 c

    The first endpoint of the destination range [c, d].

    float2 d

    The second endpoint of the destination range [c, d].

    float2 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    float2

    The componentwise remap of input x from the source range to the destination range.

    remap(float3, float3, float3, float3, float3)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static float3 remap(float3 a, float3 b, float3 c, float3 d, float3 x)
    Parameters
    Type Name Description
    float3 a

    The first endpoint of the source range [a,b].

    float3 b

    The second endpoint of the source range [a, b].

    float3 c

    The first endpoint of the destination range [c, d].

    float3 d

    The second endpoint of the destination range [c, d].

    float3 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    float3

    The componentwise remap of input x from the source range to the destination range.

    remap(float4, float4, float4, float4, float4)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static float4 remap(float4 a, float4 b, float4 c, float4 d, float4 x)
    Parameters
    Type Name Description
    float4 a

    The first endpoint of the source range [a,b].

    float4 b

    The second endpoint of the source range [a, b].

    float4 c

    The first endpoint of the destination range [c, d].

    float4 d

    The second endpoint of the destination range [c, d].

    float4 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    float4

    The componentwise remap of input x from the source range to the destination range.

    remap(double, double, double, double, double)

    Returns the result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static double remap(double a, double b, double c, double d, double x)
    Parameters
    Type Name Description
    double a

    The first endpoint of the source range [a,b].

    double b

    The second endpoint of the source range [a, b].

    double c

    The first endpoint of the destination range [c, d].

    double d

    The second endpoint of the destination range [c, d].

    double x

    The value to remap from the source to destination range.

    Returns
    Type Description
    double

    The remap of input x from the source range to the destination range.

    remap(double2, double2, double2, double2, double2)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static double2 remap(double2 a, double2 b, double2 c, double2 d, double2 x)
    Parameters
    Type Name Description
    double2 a

    The first endpoint of the source range [a,b].

    double2 b

    The second endpoint of the source range [a, b].

    double2 c

    The first endpoint of the destination range [c, d].

    double2 d

    The second endpoint of the destination range [c, d].

    double2 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    double2

    The componentwise remap of input x from the source range to the destination range.

    remap(double3, double3, double3, double3, double3)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static double3 remap(double3 a, double3 b, double3 c, double3 d, double3 x)
    Parameters
    Type Name Description
    double3 a

    The first endpoint of the source range [a,b].

    double3 b

    The second endpoint of the source range [a, b].

    double3 c

    The first endpoint of the destination range [c, d].

    double3 d

    The second endpoint of the destination range [c, d].

    double3 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    double3

    The componentwise remap of input x from the source range to the destination range.

    remap(double4, double4, double4, double4, double4)

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [a, b] to the destination range [c, d].

    Declaration
    public static double4 remap(double4 a, double4 b, double4 c, double4 d, double4 x)
    Parameters
    Type Name Description
    double4 a

    The first endpoint of the source range [a,b].

    double4 b

    The second endpoint of the source range [a, b].

    double4 c

    The first endpoint of the destination range [c, d].

    double4 d

    The second endpoint of the destination range [c, d].

    double4 x

    The value to remap from the source to destination range.

    Returns
    Type Description
    double4

    The componentwise remap of input x from the source range to the destination range.

    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)