Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add point distance functions
- Loading branch information
Showing
with
5 additions
and
1 deletion.
-
+5
−1
src/utils.coffee
|
|
@@ -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 |
|
|
|
|
|
|
|
|
|