Skip to content

Instantly share code, notes, and snippets.

@krazyjakee
Created June 20, 2013 16:21

Revisions

  1. krazyjakee created this gist Jun 20, 2013.
    4 changes: 4 additions & 0 deletions Distance Calculator
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    distance = ( p1, p2 ) ->
    x = p2.x - p1.x
    y = p2.y - p1.y
    return Math.sqrt x*x + y*y