@Test public void lineSegmentIntersections() { ICircle circle = Circle.createCircle(Vector2.fromXY(200, -200), 100); ILineSegment line; line = Lines.segmentFromPoints(Vector2.fromXY(0, 0), Vector2.fromXY(200, -200)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(129.289, -129.289)); line = Lines.segmentFromPoints(Vector2.fromXY(200, 0), Vector2.fromXY(0, -400)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(100, -200), Vector2.fromXY(140, -120)); line = Lines.segmentFromPoints(Vector2.fromXY(400, -300), Vector2.fromXY(0, -300)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(200, -300)); line = Lines.segmentFromPoints(Vector2.fromXY(100, -100), Vector2.fromXY(0, 0)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)).isEmpty(); }
public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line) { return lineIntersectionsInternal(circle, line.toLine()) .stream() .filter(line::isPointOnLine) .collect(Collectors.toList()); }
CircleMath { public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line) { return lineIntersectionsInternal(circle, line.toLine()) .stream() .filter(line::isPointOnLine) .collect(Collectors.toList()); } }
CircleMath { public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line) { return lineIntersectionsInternal(circle, line.toLine()) .stream() .filter(line::isPointOnLine) .collect(Collectors.toList()); } @SuppressWarnings("unused") private  CircleMath(); }
CircleMath { public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line) { return lineIntersectionsInternal(circle, line.toLine()) .stream() .filter(line::isPointOnLine) .collect(Collectors.toList()); } @SuppressWarnings("unused") private  CircleMath(); static List<IVector2> tangentialIntersections(final ICircle circle, final IVector2 externalPoint); static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line); static List<IVector2> circleIntersections(final ICircle firstCircle, final ICircle secondCircle); static IVector2 nearestPointOutsideCircle(final ICircular circle, final IVector2 point); static boolean isPointInCircle(ICircular circle, IVector2 point, double margin); static boolean isPointInArc(final IArc arc, final IVector2 point, double margin); static IVector2 nearestPointOutsideArc(final IArc arc, final IVector2 point); static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle); }
CircleMath { public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line) { return lineIntersectionsInternal(circle, line.toLine()) .stream() .filter(line::isPointOnLine) .collect(Collectors.toList()); } @SuppressWarnings("unused") private  CircleMath(); static List<IVector2> tangentialIntersections(final ICircle circle, final IVector2 externalPoint); static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line); static List<IVector2> circleIntersections(final ICircle firstCircle, final ICircle secondCircle); static IVector2 nearestPointOutsideCircle(final ICircular circle, final IVector2 point); static boolean isPointInCircle(ICircular circle, IVector2 point, double margin); static boolean isPointInArc(final IArc arc, final IVector2 point, double margin); static IVector2 nearestPointOutsideArc(final IArc arc, final IVector2 point); static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle);  }