Skip to content

Instantly share code, notes, and snippets.

@AlainBarrios
Last active April 3, 2020 20:28
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 AlainBarrios/f825e36c6595373c3bd38a7d6e5d54de to your computer and use it in GitHub Desktop.
Save AlainBarrios/f825e36c6595373c3bd38a7d6e5d54de to your computer and use it in GitHub Desktop.
Distribute the points in the form of a grid like this https://codepen.io/AlainBarrios/pen/mQwMPd
for (let i = 0; i < gridLength; i++) {
for (let j = 0; j < gridLength; j++) {
const x = c.width / (gridLength + 1) * (j + 1);
const y = c.height / (gridLength + 1) * (i + 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment