Created
April 5, 2013 09:43
-
-
Save stephen-james/5318026 to your computer and use it in GitHub Desktop.
Distance from Origin, distance between two pixels
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
// using pythags awesomeness | |
var distanceFromOrigin = Math.sqrt(Math.pow(origin.x - e.clientX, 2) + Math.pow(origin.y - e.clientY, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment