Skip to content

Instantly share code, notes, and snippets.

@carolina-vallejo
Created April 12, 2018 09:28
Show Gist options
  • Save carolina-vallejo/bfc7bb53ea98bd8cb3f39987998961f0 to your computer and use it in GitHub Desktop.
Save carolina-vallejo/bfc7bb53ea98bd8cb3f39987998961f0 to your computer and use it in GitHub Desktop.
midpoint calculation between two coordinates middle point
function midpoint(x1, y1, x2, y2, per) {
return [x1 + (x2 - x1) * per, y1 + (y2 - y1) * per];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment