@Test public void testIntersectsLineSegment() { segment1 = new LineSegment(0, 0, 10, 0); segment2 = new LineSegment(5, -5, 5, 5); Assert.assertEquals(true, segment1.intersects(segment2)); Assert.assertEquals(true, segment2.intersects(segment1)); segment2 = new LineSegment(15, -5, 15, 5); Assert.assertEquals(false, segment1.intersects(segment2)); Assert.assertEquals(false, segment2.intersects(segment1)); }
public boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2) { return Intersector.intersectLineSegments(pointA.x, pointA.y, pointB.x, pointB.y, segmentX1, segmentY1, segmentX2, segmentY2); }
LineSegment implements Disposable { public boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2) { return Intersector.intersectLineSegments(pointA.x, pointA.y, pointB.x, pointB.y, segmentX1, segmentY1, segmentX2, segmentY2); } }
LineSegment implements Disposable { public boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2) { return Intersector.intersectLineSegments(pointA.x, pointA.y, pointB.x, pointB.y, segmentX1, segmentY1, segmentX2, segmentY2); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); }
LineSegment implements Disposable { public boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2) { return Intersector.intersectLineSegments(pointA.x, pointA.y, pointB.x, pointB.y, segmentX1, segmentY1, segmentX2, segmentY2); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); void dispose(); void setDisposed(boolean disposed); void set(float x1, float y1, float x2, float y2); boolean contains(float x, float y); boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2); boolean intersects(LineSegment lineSegment); @Deprecated Point getIntersection(LineSegment lineSegment); boolean getIntersection(LineSegment lineSegment, Point result); boolean intersects(Rectangle rectangle); Point getPointA(); void setPointA(Point pointA); Point getPointB(); void setPointB(Point pointB); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float getLength(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
LineSegment implements Disposable { public boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2) { return Intersector.intersectLineSegments(pointA.x, pointA.y, pointB.x, pointB.y, segmentX1, segmentY1, segmentX2, segmentY2); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); void dispose(); void setDisposed(boolean disposed); void set(float x1, float y1, float x2, float y2); boolean contains(float x, float y); boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2); boolean intersects(LineSegment lineSegment); @Deprecated Point getIntersection(LineSegment lineSegment); boolean getIntersection(LineSegment lineSegment, Point result); boolean intersects(Rectangle rectangle); Point getPointA(); void setPointA(Point pointA); Point getPointB(); void setPointB(Point pointB); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float getLength(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }