So it looks like this:
Last active
December 14, 2015 06:09
-
-
Save jasonblanchard/5040071 to your computer and use it in GitHub Desktop.
I need a function that will take a number of outer circles and the x, y coordinates of the inner circle and returns x, y values for each outer circle such that they will be evenly spaced around the inner circle. Something like this:
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
function placeCircles(inner-circle-x, inner-circle-y, number-of-outter-outter-circles) { | |
/* Some math-ey stuff */ | |
/* The math-ey stuff returns an array of arrays with x, y coordinates for each outer circle */ | |
} | |
placeCircles(50, 50, 5) // Returns [ [50, 10], [75, 35], [75, 75], [35, 75], [35, 35] ] (or something) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment