[ Web Proxy ]
URL:
Viewing: https://docs.unity3d.com/ScriptReference/Unity.Mathematics.math-remap.html [Back]  [Original]

Unity - Scripting API: Unity.Mathematics.math.remap
Version: Unity 6.5 (6000.5)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    math.remap

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close
    Your name Your email Suggestion* Submit suggestion

    Cancel

    Declaration

    public static float remap(float srcStart, float srcEnd, float dstStart, float dstEnd, float x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static float2 remap(float2 srcStart, float2 srcEnd, float2 dstStart, float2 dstEnd, float2 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static float3 remap(float3 srcStart, float3 srcEnd, float3 dstStart, float3 dstEnd, float3 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static float4 remap(float4 srcStart, float4 srcEnd, float4 dstStart, float4 dstEnd, float4 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static double remap(double srcStart, double srcEnd, double dstStart, double dstEnd, double x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static double2 remap(double2 srcStart, double2 srcEnd, double2 dstStart, double2 dstEnd, double2 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static double3 remap(double3 srcStart, double3 srcEnd, double3 dstStart, double3 dstEnd, double3 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Declaration

    public static double4 remap(double4 srcStart, double4 srcEnd, double4 dstStart, double4 dstEnd, double4 x);

    Parameters

    Parameter Description
    srcStart The start point of the source range [srcStart, srcEnd].
    srcEnd The end point of the source range [srcStart, srcEnd].
    dstStart The start point of the destination range [dstStart, dstEnd].
    dstEnd The end point of the destination range [dstStart, dstEnd].
    x The value to remap from the source to destination range.

    Returns

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

    Description

    Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd].


    Web Proxy Viewer  |  New URL  |  Original Page