@Test public void stepAlongCircle() { IVector2 center = Vector2.fromXY(100, 100); assertThat(CircleMath.stepAlongCircle(Vector2.fromXY(300, 100), center, Math.PI / 2) .distanceTo(Vector2.fromXY(100, 300)) < 1e-3).isTrue(); assertThat(CircleMath.stepAlongCircle(Vector2.fromXY(200, 200), center, Math.PI) .distanceTo(Vector2.fromXY(0, 0)) < 1e-3).isTrue(); assertThat(CircleMath.stepAlongCircle(Vector2.fromXY(100, 100), center, Math.PI) .distanceTo(Vector2.fromXY(100, 100)) < 1e-3).isTrue(); }
public static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle) { return current.subtractNew(center).turn(angle).add(center); }
CircleMath { public static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle) { return current.subtractNew(center).turn(angle).add(center); } }
CircleMath { public static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle) { return current.subtractNew(center).turn(angle).add(center); } @SuppressWarnings("unused") private  CircleMath(); }
CircleMath { public static Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle) { return current.subtractNew(center).turn(angle).add(center); } @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 Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle) { return current.subtractNew(center).turn(angle).add(center); } @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);  }