Package org.htmlunit.util.geometry
Class Line2D
- java.lang.Object
-
- org.htmlunit.util.geometry.Line2D
-
-
Field Summary
Fields Modifier and Type Field Description private doubleendX_private doubleendY_private booleanisVertical_private doubleslope_private doublestartX_private doublestartY_private doubleyIntercept_
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)Point2Dintersect(Line2D line)booleanisEmpty()java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-