docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method IsApproxZero

    IsApproxZero(float, float)

    Checks if the given float is almost zero, using an absolute tolerance.

    Declaration
    public static bool IsApproxZero(float f, float toleranceSquared = 1E-12)
    Parameters
    Type Name Description
    float f

    The float to check.

    float toleranceSquared

    The absolute tolerance, squared. The default value is EpsilonSquared.

    Returns
    Type Description
    bool

    True if the magnitude of the given value is smaller than the tolerance.

    IsApproxZero(Vector2, float)

    Checks if the magnitude of the given 2D vector is almost zero, using an absolute tolerance.

    Declaration
    public static bool IsApproxZero(Vector2 v, float toleranceSquared = 1E-12)
    Parameters
    Type Name Description
    Vector2 v

    The 2D vector to check.

    float toleranceSquared

    The absolute tolerance, squared. The default value is EpsilonSquared.

    Returns
    Type Description
    bool

    True if the magnitude of the given value is smaller than the tolerance.

    IsApproxZero(Vector3, float)

    Checks if the magnitude of the given 3D vector is almost zero, using an absolute tolerance.

    Declaration
    public static bool IsApproxZero(Vector3 v, float toleranceSquared = 1E-12)
    Parameters
    Type Name Description
    Vector3 v

    The 3D vector to check.

    float toleranceSquared

    The absolute tolerance, squared. The default value is EpsilonSquared.

    Returns
    Type Description
    bool

    True if the magnitude of the given value is smaller than the tolerance.

    IsApproxZero(Vector4, float)

    Checks if the magnitude of the given 4D vector is almost zero, using an absolute tolerance.

    Declaration
    public static bool IsApproxZero(Vector4 v, float toleranceSquared = 1E-12)
    Parameters
    Type Name Description
    Vector4 v

    The 4D vector to check.

    float toleranceSquared

    The absolute tolerance, squared. The default value is EpsilonSquared.

    Returns
    Type Description
    bool

    True if the magnitude of the given value is smaller than the tolerance.

    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)