Skip to content

Instantly share code, notes, and snippets.

@BenMaydan
Created September 22, 2019 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenMaydan/fee364153e6b8c33b810e5286c7485f2 to your computer and use it in GitHub Desktop.
Save BenMaydan/fee364153e6b8c33b810e5286c7485f2 to your computer and use it in GitHub Desktop.
Java plug in "function" to determine the x and y coordinates of a point of a circle at a certain radian. The way this is written the angle 0 starts on the far right of the circle and goes clockwise.
class Circle() {
float[] pointOnCircle(int x, int y, float rad, float radians) {
return new float[] {x+(rad * cos(radians)), y+(rad * sin(radians))};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment