Last active
March 10, 2019 12:21
-
-
Save ezhov-da/c9b12b904043d6cae640600d158fcccf to your computer and use it in GitHub Desktop.
java координаты точки на окружности
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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