Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezhov-da/c9b12b904043d6cae640600d158fcccf to your computer and use it in GitHub Desktop.
Save ezhov-da/c9b12b904043d6cae640600d158fcccf to your computer and use it in GitHub Desktop.
java координаты точки на окружности
[code:]java[:code]
private Point calculateCenterCircleSmall(int sizeCircle, Point center, double angle)
{
//x0,y0 - центр, a - угол, r - радиус.
int radius = sizeCircle / 2;
int x = (int) (center.x + radius * Math.cos(Math.toRadians(angle)));
int y = (int) (center.y + radius * Math.sin(Math.toRadians(angle)));
return new Point(x, y);
}
[/code]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment