Skip to main content

Line2d

The Line2d class describes a line in a plane. A line is infinte by definition. It is derived from the VisionElement base class.

Constructors

Empty constructor.

new Line2d(): Line2d;

Constructor with the coordinates of two points of the line.

new Line2d(x1: number, y1: number, x2: number, y2: number): Line2d;

Constructor with the 3 parameters of the line equation. The line equation is a*x + b*y + c = 0.

new Line2d(a: number, b: number, c: number): Line2d;

Constructor with two points of the line.

new Line2d(point1: Point2d, point2: Point2d): Line2d;

Constructor with a point and a rotation angle in degrees relative to the X axis.

new Line2d(point: Point2d, rotation: number): Line2d;

Constructor with a reference line, a point of the new line, and a rotation offset in degrees.

new Line2d(lineRef: Line2d, point: Point2d, rotationOffset: number): Line2d;

Methods

isValid()

Returns true if the line parameters are valid.

isValid(): boolean;

Value

a

The a parameter of the line equation a*x + b*y + c = 0.

a: number;

b

The b parameter of the line equation a*x + b*y + c = 0.

b: number;

c

The c parameter of the line equation a*x + b*y + c = 0.

c: number;

Props

color

The color of the line in hexadecimal format.

color: string;