So I\'m trying to figure out how to implement a method of selecting lines or edges in a drawing area but my math is a bit lacking. This is what I got so far:
Sorry, mathematics are still required... This is from java.awt.geom.Line2D:
public boolean contains(double x, double y)
Tests if a specified coordinate is inside the boundary of this Line2D. This method is required to implement the Shape interface, but in the case of Line2D objects it always returns false since a line contains no area.
Specified by: contains in interface Shape
Parameters: x - the X coordinate of the specified point to be tested y - the Y coordinate of the specified point to be tested
Returns: false because a Line2D contains no area.
Since: 1.2
I recommend Tojis answer