@Test public void lineIntersectionsCircle() { ICircle circle = Circle.createCircle(Vector2.fromXY(-300, 200), 100); ILine line; line = Lines.lineFromPoints(Vector2.fromXY(400, 400), Vector2.fromXY(0, 300)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(-400, 200), Vector2.fromXY(-211.765, 247.059)); line = Lines.lineFromPoints(Vector2.fromXY(-700, 500), Vector2.fromXY(-500, 300)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(-300, 100), Vector2.fromXY(-400, 200)); line = Lines.lineFromPoints(Vector2.fromXY(-400, 600), Vector2.fromXY(-400, 100)); Assertions.assertThat(CircleMath.lineIntersections(circle, line)) .containsExactlyInAnyOrder(Vector2.fromXY(-400, 200)); line = Lines.lineFromPoints(Vector2.fromXY(100, 200), Vector2.fromXY(0, 100)); 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);  }