Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distanceBetween seems to have an obvious bug... #22

Closed
rozim opened this issue Jan 6, 2012 · 1 comment
Closed

distanceBetween seems to have an obvious bug... #22

rozim opened this issue Jan 6, 2012 · 1 comment

Comments

@rozim
Copy link

rozim commented Jan 6, 2012

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)

@ippa
Copy link
Owner

ippa commented Jan 6, 2012

tnx for the report, fixed in d19fc9f

@ippa ippa closed this as completed Jan 6, 2012
abachman pushed a commit to abachman/jaws that referenced this issue Dec 29, 2013
abachman pushed a commit to abachman/jaws that referenced this issue Dec 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants