From 7729d084e970342a129f2b4c27ff5bfaa1b7d455 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 4 Aug 2012 00:11:19 +0200 Subject: [PATCH] Add point_distance function --- core.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core.js b/core.js index 7d3ab30..80c6abe 100644 --- a/core.js +++ b/core.js @@ -22,4 +22,11 @@ Function.prototype.inheritsFrom = function(parentObject) /*Class*/ RadiumEngine = function() { this.version = "1.0"; + + var point_distance = this.point_distance = function(x1, y1, x2, y2) + { + var xL = x1 - x2; + var yL = y1 - y2; + return Math.sqrt((xL * xL) + (yL * yL)); + } }