Package org.htmlunit.util.geometry
Class Line2D
java.lang.Object
org.htmlunit.util.geometry.Line2D
- All Implemented Interfaces:
Shape2D
Simple 2D shape line.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double
private final double
private final boolean
private final double
private final double
private final double
private final double
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
startX_
private final double startX_ -
startY_
private final double startY_ -
endX_
private final double endX_ -
endY_
private final double endY_ -
isVertical_
private final boolean isVertical_ -
slope_
private final double slope_ -
yIntercept_
private final double yIntercept_
-
-
Constructor Details
-
Line2D
Ctor.- Parameters:
start
- the start pointend
- the end point
-
Line2D
public Line2D(double x1, double y1, double x2, double y2) Ctor.- Parameters:
x1
- the x value of the start pointy1
- the y value of the start pointx2
- the x value of the end pointy2
- the y value of the end point
-
-
Method Details
-
intersect
- Parameters:
line
- the line to intersect this with- Returns:
- the intersection point of the two lines or null if they are parallel
-
contains
public boolean contains(double x, double y) -
isEmpty
public boolean isEmpty() -
toString
-