docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method DistancePointLine

    DistancePointLine(float3, float3, float3)

    Gets the distance from a point to a line segment.

    Declaration
    public static float DistancePointLine(float3 p, float3 a, float3 b)
    Parameters
    Type Name Description
    float3 p

    The point to compare against.

    float3 a

    The start point of the line segment.

    float3 b

    The end point of the line segment.

    Returns
    Type Description
    float

    Returns the distance of the closest line from a point to a line segment.

    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)