java.lang.Object
org.htmlunit.util.geometry.Line2D
- All Implemented Interfaces:
Shape2D
Simple 2D line segment shape.
- Author:
- Ronald Brill
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Line2D
Creates a new line segment between the two given points.- Parameters:
start- the start pointend- the end point
-
Line2D
public Line2D(double x1, double y1, double x2, double y2) Creates a new line segment between the two given coordinates.- Parameters:
x1- the x coordinate of the start pointy1- the y coordinate of the start pointx2- the x coordinate of the end pointy2- the y coordinate of the end point
-
-
Method Details
-
intersect
Returns the intersection point of this line with the given line, ornullif the lines are parallel.- Parameters:
line- the line to intersect with- Returns:
- the intersection point, or
nullif the lines are parallel
-
contains
public boolean contains(double x, double y) Returns whether the specified point lies inside this shape. -
isEmpty
public boolean isEmpty()Returns whether this shape is empty. -
toString
-