Package org.htmlunit.util.geometry
Class Line2D
- java.lang.Object
-
- org.htmlunit.util.geometry.Line2D
-
-
Field Summary
Fields Modifier and Type Field Description private double
endX_
private double
endY_
private boolean
isVertical_
private double
slope_
private double
startX_
private double
startY_
private double
yIntercept_
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(double x, double y)
Point2D
intersect(Line2D line)
boolean
isEmpty()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Line2D
public Line2D(Point2D start, Point2D end)
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 Detail
-
intersect
public Point2D intersect(Line2D line)
- 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-