docs.unity.cn
    Show / Hide Table of Contents

    Method lengthsq

    lengthsq(Single)

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

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

    Value to use when computing squared length.

    Returns
    Type Description
    Single

    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
    Single

    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
    Single

    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
    Single

    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
    Single

    The length squared of the input quaternion.

    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