Class: Line2D

vector.Line2D(point, direction)

A line in a two-dimensional space.

Constructor

new Line2D(point, direction)

Creates a new line.

Parameters:
Name Type Description
point Vector2D

A point on the line.

direction Vector2D

The direction of the line.

Methods

perpendicular(point) → {Object}

Returns the perpendicular of a point on this line.

Parameters:
Name Type Description
point Vector2D

A point.

Returns:

The foot and the scalar.

Type
Object

(static) fromPoints(a, b) → {Line2D}

Creates a line from 2 points.

Parameters:
Name Type Description
a Vector2D

The first point.

b Vector2D

The second point.

Returns:

The line from a to b.

Type
Line2D