#include #include #include #include "location.h" #include "shortest_path.h" location_t::~location_t() { delete[] neighbors; } void location_t::set_neighbors(location_t* list[]) { neighbors = list; for(nb_neighbors = 0; list[nb_neighbors] != nullptr; nb_neighbors++) { } } double location_t::distance_to(location_t* to) { return 6378 * (std::numbers::pi/2 - std::asin(std::sin(to->latitude) * std::sin(latitude) + std::cos(to->longitude - longitude) * std::cos(to->latitude) * std::cos(latitude))); }