In making a project for class, we are defining shapes (triangle, quadrilateral, pentagon) without the help of the Shape
class obviously.
In my checks to make sure the shape is valid, I use Line2D.Double linesIntersect()
to determine if the connections between two sets of points (p1-p4 x p2-p3)
. When I have my input to linesIntersect(double,double,double,double,etc)
set to:
p1(-1,-1)
p2(-1,-11)
p3(5,0)
p4(5,5)
It tells me that the line from p1
to p4
crosses the line from p2
to p3
. When in fact they should be two diagonal parallel lines.
Any help?