kopia lustrzana https://gitlab.com/tomaszg/geostat
Add distance to the Moon
rodzic
c133eb70ca
commit
c29f97546a
1
cache.h
1
cache.h
|
@ -39,6 +39,7 @@ enum Status {
|
|||
};
|
||||
|
||||
const int Earth_radius = 6378;
|
||||
const int Moon_dist = 384400;
|
||||
|
||||
class Position {
|
||||
public:
|
||||
|
|
|
@ -450,7 +450,7 @@ int main(int argc, char** argv) {
|
|||
//std::cout << "Distance between " << i->second->name << " and " << std::next(i)->second->name << " is " << cache_distance(*i->second, *std::next(i)->second) << "<br>";
|
||||
tot_dist += cache_distance(*i->second, *std::next(i)->second);
|
||||
}
|
||||
std::cout << "Total distance between caches: <span class=\"value\">" << std::fixed << tot_dist << "</span> km (equivalent to <span class=\"value\">" << tot_dist / (2 * M_PI * Earth_radius) << "x</span> trips around Earth)<br>\n";
|
||||
std::cout << "Total distance between caches: <span class=\"value\">" << std::fixed << tot_dist << "</span> km (equivalent to <span class=\"value\">" << tot_dist / (2 * M_PI * Earth_radius) << "x</span> trips around Earth or <span class=\"value\">" << tot_dist / Moon_dist << "x</span> trips to the Moon)<br>\n";
|
||||
std::cout << std::resetiosflags(std::cout.flags());
|
||||
if (sorted_fcaches.size() > 1)
|
||||
std::cout << "Average distance between caches: <span class=\"value\">" << tot_dist / (sorted_fcaches.size() - 1) << "</span> km<br>\n";
|
||||
|
|
Ładowanie…
Reference in New Issue