clang format

This commit is contained in:
Huyen Chau Nguyen 2018-04-25 16:37:37 -04:00 committed by Patrick Niklaus
parent b573485c31
commit 7837cd61df

View File

@ -22,16 +22,23 @@ namespace coordinate_calculation
namespace
{
class CheapRulerContainer {
class CheapRulerContainer
{
public:
CheapRulerContainer(const int number_of_rulers)
: cheap_ruler_cache(number_of_rulers, mapbox::cheap_ruler::CheapRuler(0)), step(90.0 / number_of_rulers) {
for (int n = 0; n < number_of_rulers; n++) {
cheap_ruler_cache[n] = mapbox::cheap_ruler::CheapRuler(step * (n + 0.5), mapbox::cheap_ruler::CheapRuler::Meters);
: cheap_ruler_cache(number_of_rulers, mapbox::cheap_ruler::CheapRuler(0)),
step(90.0 / number_of_rulers)
{
for (int n = 0; n < number_of_rulers; n++)
{
cheap_ruler_cache[n] = mapbox::cheap_ruler::CheapRuler(
step * (n + 0.5), mapbox::cheap_ruler::CheapRuler::Meters);
}
};
mapbox::cheap_ruler::CheapRuler& getRuler(const double lat) {
return cheap_ruler_cache[std::min((int)std::floor(abs(lat)/step), (int)cheap_ruler_cache.size() - 1)];
mapbox::cheap_ruler::CheapRuler &getRuler(const double lat)
{
return cheap_ruler_cache[std::min((int)std::floor(abs(lat) / step),
(int)cheap_ruler_cache.size() - 1)];
};
private: