@Test public void lineIntersectionsArc() { ILine line; IVector2 center = Vector2.fromXY(-200, 100); IArc arc = Arc.createArc(center, 300, Math.PI, 3 * Math.PI / 4); line = Lines.lineFromPoints(Vector2.fromXY(-800, 200), Vector2.fromXY(200, -200)); Assertions.assertThat(CircleMath.lineIntersections(arc, line)) .containsExactlyInAnyOrder(Vector2.fromXY(2.762, -121.105), Vector2.fromXY(-499.314, 79.726)); line = Lines.lineFromPoints(Vector2.fromXY(-800, -200), Vector2.fromXY(200, 200)); Assertions.assertThat(CircleMath.lineIntersections(arc, line)) .containsExactlyInAnyOrder(Vector2.fromXY(-453.009, -61.204)); line = Lines.lineFromPoints(Vector2.fromXY(200, -200), Vector2.fromXY(-400, 100)); Assertions.assertThat(CircleMath.lineIntersections(arc, 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);  }