docs.unity.cn
    Show / Hide Table of Contents

    Method atan2

    atan2(Single, Single)

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

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

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

    Single x

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

    Returns
    Type Description
    Single

    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.

    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