docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method length

    length(float)

    Returns the length of a float value. Equivalent to the absolute value.

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

    Value to use when computing length.

    Returns
    Type Description
    float

    Length of x.

    length(float2)

    Returns the length of a float2 vector.

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

    Vector to use when computing length.

    Returns
    Type Description
    float

    Length of vector x.

    length(float3)

    Returns the length of a float3 vector.

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

    Vector to use when computing length.

    Returns
    Type Description
    float

    Length of vector x.

    length(float4)

    Returns the length of a float4 vector.

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

    Vector to use when computing length.

    Returns
    Type Description
    float

    Length of vector x.

    length(double)

    Returns the length of a double value. Equivalent to the absolute value.

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

    Value to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of x.

    length(double2)

    Returns the length of a double2 vector.

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

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    length(double3)

    Returns the length of a double3 vector.

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

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    length(double4)

    Returns the length of a double4 vector.

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

    Vector to use when computing squared length.

    Returns
    Type Description
    double

    Squared length of vector x.

    length(quaternion)

    Returns the length of a quaternion.

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

    The input quaternion.

    Returns
    Type Description
    float

    The length 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)