Skip to content

Commit

Permalink
feat: fix euclidean heuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
auspham committed Jan 5, 2024
1 parent 1b2f3d1 commit 8efc76d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "byakugan-js",
"version": "0.1.2",
"version": "0.1.3",
"description": "A simple implementation of A* Pathfinding algorithm for sensory type ninjas.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/components/heuristics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Heuristics {

private functions: Object = {
EUCLIDEAN: (a: Node, b: Node) => {
Math.hypot(a.row - b.row, a.col - b.col);
return Math.hypot(a.row - b.row, a.col - b.col);
},
MANHATTAN: (a: Node, b: Node) => {
let dx = Math.abs(a.col - b.col);
Expand Down

0 comments on commit 8efc76d

Please sign in to comment.