A line segment between two points. More...
Public Member Functions | |
LineSegment (Point2D p0, Point2D p1) | |
Creates a line segment based on the two given points p0 and p1 . | |
LineSegment (int x0, int y0, int x1, int y1) | |
Creates a line segment based on the given coordinates. | |
Point2D[] | CalculatePointsOnLine () |
Calculates all the points on this line. | |
Properties | |
Point2D | P0 [get, set] |
Start point. | |
Point2D | P1 [get, set] |
End point. | |
double | Length [get] |
Gets the length of this line segment. | |
A line segment between two points.
LineSegment | ( | Point2D | p0, |
Point2D | p1 ) |
Creates a line segment based on the two given points p0 and p1 .
p0 | Start point. |
p1 | End point. |
LineSegment | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1 ) |
Creates a line segment based on the given coordinates.
x0 | Start point X. |
y0 | Start point Y. |
x1 | End point X. |
y1 | End point Y. |
Point2D[] CalculatePointsOnLine | ( | ) |
Calculates all the points on this line.
Uses the Bresenham algorithm to calculate the points on this segment.