Package turtle
Class LineSegment
java.lang.Object
turtle.LineSegment
public class LineSegment extends Object
An immutable line segment in pixel space.
PS0 instructions: do NOT change this class.
-
Constructor Summary
Constructors Constructor Description LineSegment(double startx, double starty, double endx, double endy, PenColor color)
Construct a line segment from coordinate pairs.LineSegment(Point start, Point end, PenColor color)
Construct a line segment from start and end points. -
Method Summary
-
Constructor Details
-
LineSegment
Construct a line segment from coordinate pairs.- Parameters:
startx
- x-coordinate of start pointstarty
- y-coordinate of start pointendx
- x-coordinate of end pointendy
- y-coordinate of end pointcolor
- line segment color
-
LineSegment
Construct a line segment from start and end points.- Parameters:
start
- one end of the line segmentend
- the other end of the line segmentcolor
- line segment color
-
-
Method Details