MCPcopy Create free account
hub / github.com/esengine/esengine / euclideanDistance

Function euclideanDistance

packages/pathfinding/src/core/IPathfinding.ts:130–134  ·  view source on GitHub ↗
(a: IPoint, b: IPoint)

Source from the content-addressed store, hash-verified

128 * @en Euclidean distance (any direction movement)
129 */
130export function euclideanDistance(a: IPoint, b: IPoint): number {
131 const dx = a.x - b.x;
132 const dy = a.y - b.y;
133 return Math.sqrt(dx * dx + dy * dy);
134}
135
136/**
137 * @zh 切比雪夫距离(8方向移动)

Callers 5

heuristicMethod · 0.90
getMovementCostMethod · 0.90
findPathMethod · 0.90
findPolygonPathMethod · 0.90
calculatePathLengthMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected