(a: IPoint, b: IPoint)
| 128 | * @en Euclidean distance (any direction movement) |
| 129 | */ |
| 130 | export 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方向移动) |
no outgoing calls
no test coverage detected