Last active
September 17, 2017 09:05
-
-
Save jabranr/fe5f4ef5bbfdc7597df126586c709251 to your computer and use it in GitHub Desktop.
(Math) Find distance between two known points
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
// Point a1 | |
// Point a2 | |
let dx = a2.x - a1.x; | |
let dy = a2.y - a1.y; | |
let distance = Math.sqrt(dx*dx + dy*dy); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment