Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

HandleUtility.DistancePointToLineSegment

static function DistancePointToLineSegment(p: Vector2, a: Vector2, b: Vector2): float;
static float DistancePointToLineSegment(Vector2 p, Vector2 a, Vector2 b);
static def DistancePointToLineSegment(p as Vector2, a as Vector2, b as Vector2) as float

Description

Distance from a point p in 2d to a line segment defined by two points a and b.