docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method atan2

    atan2(float, float)

    Returns the 2-argument arctangent of a pair of float values.

    Declaration
    public static float atan2(float y, float x)
    Parameters
    Type Name Description
    float y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    float x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    float

    The arctangent of the ratio y/x, in radians.

    atan2(float2, float2)

    Returns the componentwise 2-argument arctangent of a pair of floats2 vectors.

    Declaration
    public static float2 atan2(float2 y, float2 x)
    Parameters
    Type Name Description
    float2 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    float2 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    float2

    The componentwise arctangent of the ratio y/x, in radians.

    atan2(float3, float3)

    Returns the componentwise 2-argument arctangent of a pair of floats3 vectors.

    Declaration
    public static float3 atan2(float3 y, float3 x)
    Parameters
    Type Name Description
    float3 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    float3 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    float3

    The componentwise arctangent of the ratio y/x, in radians.

    atan2(float4, float4)

    Returns the componentwise 2-argument arctangent of a pair of floats4 vectors.

    Declaration
    public static float4 atan2(float4 y, float4 x)
    Parameters
    Type Name Description
    float4 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    float4 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    float4

    The componentwise arctangent of the ratio y/x, in radians.

    atan2(double, double)

    Returns the 2-argument arctangent of a pair of double values.

    Declaration
    public static double atan2(double y, double x)
    Parameters
    Type Name Description
    double y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    double x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    double

    The arctangent of the ratio y/x, in radians.

    atan2(double2, double2)

    Returns the 2-argument arctangent of a pair of double2 vectors.

    Declaration
    public static double2 atan2(double2 y, double2 x)
    Parameters
    Type Name Description
    double2 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    double2 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    double2

    The componentwise arctangent of the ratio y/x, in radians.

    atan2(double3, double3)

    Returns the 2-argument arctangent of a pair of double3 vectors.

    Declaration
    public static double3 atan2(double3 y, double3 x)
    Parameters
    Type Name Description
    double3 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    double3 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    double3

    The componentwise arctangent of the ratio y/x, in radians.

    atan2(double4, double4)

    Returns the 2-argument arctangent of a pair of double4 vectors.

    Declaration
    public static double4 atan2(double4 y, double4 x)
    Parameters
    Type Name Description
    double4 y

    Numerator of the ratio y/x, usually the y component on the unit circle.

    double4 x

    Denominator of the ratio y/x, usually the x component on the unit circle.

    Returns
    Type Description
    double4

    The componentwise arctangent of the ratio y/x, in radians.

    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)