kopia lustrzana https://gitlab.com/tomaszg/geostat
Might as well use M_PI instead of defining our own
rodzic
1f558ef50d
commit
f262101468
1
cache.h
1
cache.h
|
@ -39,7 +39,6 @@ enum Status {
|
|||
};
|
||||
|
||||
const int Earth_radius = 6378;
|
||||
const double Pi = 3.14159265358979323846264338327950288;
|
||||
|
||||
class Position {
|
||||
public:
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <unistd.h>
|
||||
#include <cmath>
|
||||
|
||||
void show_usage() {
|
||||
std::cout << "Usage: geostat [options]\n";
|
||||
|
@ -449,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 * 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)<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