Permalink
Browse files

Add point distance functions

  • Loading branch information...
Koen Bok
Koen Bok committed May 3, 2013
1 parent acb0e29 commit c02eef3fff6e8f1872b88dc314e7a619b79806ca
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/utils.coffee
View
@@ -1,4 +1,5 @@
_ = require "underscore"
{config} = require "./config"
Function::define = (prop, desc) ->
@@ -333,6 +334,10 @@ exports.domCompleteCancel = (f) ->
__domComplete = _.without __domComplete, f
######################################################
# POINT FUNCTIONS
exports.pointDistance = (pointA, pointB) ->
distance =
x: Math.abs(pointB.x - pointA.x)
@@ -362,4 +367,3 @@ exports.pointAbs = (point) ->
y: Math.abs point.y

0 comments on commit c02eef3

Please sign in to comment.