* Gets the 'Square' distance between the two given tiles. * The 'Square' distance is the square of the shortest (straight line) * distance between the two tiles. * Also known as Euclidean- or L2-Norm squared. * @param t0 the start tile * @param t1 the end tile * @return the distance */
| 184 | * @return the distance |
| 185 | */ |
| 186 | uint DistanceSquare(TileIndex t0, TileIndex t1) |
| 187 | { |
| 188 | const int dx = TileX(t0) - TileX(t1); |
| 189 | const int dy = TileY(t0) - TileY(t1); |
| 190 | return dx * dx + dy * dy; |
| 191 | } |
| 192 | |
| 193 | |
| 194 | /** |
no test coverage detected