-
-
Method Summary
Modifier and Type Method Description abstract Booleancontains(P point)Checks if the point belongs to this line. abstract PfindPoint(Double x)Finds the point belonging to the line with the given x-coordinate. abstract BooleanisParallelTo(Line2D<P> other)Checks if two lines are parallel. abstract Intersection2D<P>intersect(Line2D<P> other)Intersects two lines. abstract Intersection2D<P>intersectCircle(P center, Double radius)Intersects a line and a circle. abstract BooleangetIsHorizontal()Indicates if the line is aligned to the x-axis. abstract BooleangetIsVertical()Indicates if the line is aligned to the y-axis. abstract DoublegetSlope()The slope of the line, if isVertical this is undefined (= Double.NaN). abstract DoublegetYIntercept()The y-coordinate of the y-intercept (= the point where the line intersects the y-axis). abstract DoublegetXIntercept()The x-coordinate of the x-intercept (= the point where the line intersects the x-axis). -
-
Method Detail
-
findPoint
abstract P findPoint(Double x)
Finds the point belonging to the line with the given x-coordinate. Throws an UnsupportedOperationException if the line isVertical.
-
isParallelTo
abstract Boolean isParallelTo(Line2D<P> other)
Checks if two lines are parallel.
-
intersect
abstract Intersection2D<P> intersect(Line2D<P> other)
Intersects two lines.
-
intersectCircle
abstract Intersection2D<P> intersectCircle(P center, Double radius)
Intersects a line and a circle.
-
getIsHorizontal
abstract Boolean getIsHorizontal()
Indicates if the line is aligned to the x-axis.
-
getIsVertical
abstract Boolean getIsVertical()
Indicates if the line is aligned to the y-axis.
-
getSlope
abstract Double getSlope()
The slope of the line, if isVertical this is undefined (= Double.NaN).
-
getYIntercept
abstract Double getYIntercept()
The y-coordinate of the y-intercept (= the point where the line intersects the y-axis). If isVertical there's no y-intercept and this is Double.NaN. The slope-intercept representation (y = mx + b) uses this intercept.
-
getXIntercept
abstract Double getXIntercept()
The x-coordinate of the x-intercept (= the point where the line intersects the x-axis). If isHorizontal there's no x-intercept and this is Double.NaN.
-
-
-
-