Closed rozim closed 12 years ago
jaws.distanceBetween = function(object1, object2) { return Math.sqrt( Math.pow(object1.x-object2.x, 2) + Math.pow(object1.y, object2.y, 2) ) }
I think the last pow call needs to subtract the y's like this: Math.pow(object1.y - object2.y, 2)
tnx for the report, fixed in https://github.com/ippa/jaws/commit/d19fc9ff90d7cd46c4e09727355f2f9d82f720e0
jaws.distanceBetween = function(object1, object2) { return Math.sqrt( Math.pow(object1.x-object2.x, 2) + Math.pow(object1.y, object2.y, 2) ) }
I think the last pow call needs to subtract the y's like this: Math.pow(object1.y - object2.y, 2)