Created
April 14, 2024 16:19
-
-
Save kistaaa/eb367088822adb387619a955874675aa to your computer and use it in GitHub Desktop.
Circle Colision in JS
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
const checkCollision = (p1x, p1y, r1, p2x, p2y, r2) => ((r1 + r2) ** 2 > (p1x - p2x) ** 2 + (p1y - p2y) ** 2) | |
var collision = checkCollision(5, 500, 10, 1000, 1500, 1500); | |
console.log(collision); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment