Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <algorithm>
- #include "Heuristic.h"
- Coordinate Heuristic::getDelta(Coordinate source_, Coordinate target_)
- {
- return {
- abs(source_.x - target_.x),
- abs(source_.y - target_.y)
- };
- }
- int Heuristic::euclidean(Coordinate source_, Coordinate target_)
- {
- auto delta = std::move(
- getDelta(source_, target_)
- );
- return static_cast<int>(10 * sqrt(pow(delta.x, 2) + pow(delta.y, 2)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement