pixi-jsFunctions
Function: squaredDistanceToLineSegment()
> squaredDistanceToLineSegment(x, y, x1, y1, x2, y2): number
Defined in: node_modules/pixi.js/lib/maths/misc/squaredDistanceToLineSegment.d.ts:13
Internal
Calculates the squared distance from a point to a line segment defined by two endpoints.
Parameters
x
number
x coordinate of the point
y
number
y coordinate of the point
x1
number
x coordinate of the first endpoint of the line segment
y1
number
y coordinate of the first endpoint of the line segment
x2
number
x coordinate of the second endpoint of the line segment
y2
number
y coordinate of the second endpoint of the line segment
Returns
number
The squared distance from the point to the line segment