Dart Documentationorson_chartsLine2D

Line2D class

Represents a line in two-dimensional space. This class includes a draw() method for convenience when drawing lines on a canvas.

Constructors

new Line2D(num x0, num y0, num x1, num y1) #

Creates a new Line2D instance from ( x0, y0) to ( x1, y1).

new Line2D.fromPoints(Point p0, Point p1) #

Creates a new Line2D instance from p0 to p1.

Properties

num x0 #

The x-coordinate of the starting point.

num x1 #

The x-coordinate of the ending point.

num y0 #

The y-coordinate of the starting point.

num y1 #

The y-coordinate of the ending point.

Methods

void draw(CanvasRenderingContext2D context, Color color, Stroke stroke) #

Draws the line on a canvas using the specified color and stroke.

int relativeCCW(num px, num py) #