docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method lengthsq

    lengthsq(float)

    Returns the squared length of a float value. Equivalent to squaring the value.

    Declaration
    public static float lengthsq(float x)
    Parameters
    Type Name Description
    float x

    Value to use when computing squared length.

    Returns
    Type Description
    float

    Squared length of x.

    lengthsq(float2)

    Returns the squared length of a float2 vector.

    Declaration
    public static float lengthsq(float2 x)
    Parameters
    Type Name Description
    float2 x

    Vector to use when computing squared length.

    Returns
    Type Description
    float

    Squared length of vector x.

    lengthsq(float3)

    Returns the squared length of a float3 vector.

    Declaration
    public static float lengthsq(float3 x)
    Parameters
    Type Name Description
    float3 x

    Vector to use when computing squared length.

    Returns
    Type Description
    float

    Squared length of vector x.

    lengthsq(float4)

    Returns the squared length of a float4 vector.

    Declaration
    public static float lengthsq(float4 x)
    Parameters
    Type Name Description
    float4 x

    Vector to use when computing squared length.

    Returns
    Type Description
    float

    Squared length of vector x.

    lengthsq(double)

    Returns the squared length of a double value. Equivalent to squaring the value.

    Declaration
    public static double lengthsq(double x)
    Parameters
    Type Name Description
    double x

    Value to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of x.

    lengthsq(double2)

    Returns the squared length of a double2 vector.

    Declaration
    public static double lengthsq(double2 x)
    Parameters
    Type Name Description
    double2 x

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    lengthsq(double3)

    Returns the squared length of a double3 vector.

    Declaration
    public static double lengthsq(double3 x)
    Parameters
    Type Name Description
    double3 x

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    lengthsq(double4)

    Returns the squared length of a double4 vector.

    Declaration
    public static double lengthsq(double4 x)
    Parameters
    Type Name Description
    double4 x

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    lengthsq(quaternion)

    Returns the squared length of a quaternion.

    Declaration
    public static float lengthsq(quaternion q)
    Parameters
    Type Name Description
    quaternion q

    The input quaternion.

    Returns
    Type Description
    float

    The length squared of the input quaternion.

    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)