Skip to content

Fix distance between two points formula#2

Open
AymeneBahmed wants to merge 1 commit into
blakesanie:masterfrom
AymeneBahmed:fix-distance-formula
Open

Fix distance between two points formula#2
AymeneBahmed wants to merge 1 commit into
blakesanie:masterfrom
AymeneBahmed:fix-distance-formula

Conversation

@AymeneBahmed

@AymeneBahmed AymeneBahmed commented Apr 19, 2023

Copy link
Copy Markdown

the method:

distance(x1, y1, x2, y2) {
return Math.sqrt((x1 - x2) * (x1 - x2) - (y1 - y2) * (y1 - y2));
}

should be:

distance(x1, y1, x2, y2) {
return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

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

Successfully merging this pull request may close these issues.

1 participant