Slope Intercept Line2D
A Line2D represented in the slope-intercept form: y = slope * x + yIntercept. Doubles are only compared with fuzzyEquals.
Constructors
Types
Factories, constants, and utility methods for SlopeInterceptLine2D.
Properties
Indicates if the line is aligned to the x-axis.
Indicates if the line is aligned to the y-axis.
The slope of the line, if isVertical this is undefined (= Double.NaN).
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.
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.
Functions
Checks if two lines coincide.
Finds the point belonging to the line with the given x-coordinate. Throws an UnsupportedOperationException if the line isVertical.
Solves the line equation for the given x. Throws an UnsupportedOperationException if the line isVertical.
Uses slope, yIntercept and xIntercept.
Intersects a line and a circle. Radius must be positive. Intersection is performed by plugging the line equation in the circle equation and solving the resulting quadratic equation. Circle equation: (x - center.x)^2 + (y - center.y)^2 = r^2. Line equation: y = slope * x + yIntercept unless isVertical, x = xIntercept otherwise.
Checks if two lines are parallel.