mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -15,13 +15,11 @@ double CheckpointPredictor::CalculateDeltaMeters(m2::PointD const & from, m2::Po
|
||||
m2::PointD const & between)
|
||||
{
|
||||
double const directDist = mercator::DistanceOnEarth(from, to);
|
||||
double const distThroughPoint =
|
||||
mercator::DistanceOnEarth(from, between) + mercator::DistanceOnEarth(between, to);
|
||||
double const distThroughPoint = mercator::DistanceOnEarth(from, between) + mercator::DistanceOnEarth(between, to);
|
||||
return distThroughPoint - directDist;
|
||||
}
|
||||
|
||||
size_t CheckpointPredictor::PredictPosition(vector<m2::PointD> const & points,
|
||||
m2::PointD const & point) const
|
||||
size_t CheckpointPredictor::PredictPosition(vector<m2::PointD> const & points, m2::PointD const & point) const
|
||||
{
|
||||
double constexpr kInvalidDistance = numeric_limits<double>::max();
|
||||
double minDeltaMeters = kInvalidDistance;
|
||||
@@ -30,8 +28,7 @@ size_t CheckpointPredictor::PredictPosition(vector<m2::PointD> const & points,
|
||||
size_t const checkpointNum = points.size() + 2 /* for start and finish points */;
|
||||
for (size_t i = 0; i + 1 != checkpointNum; ++i)
|
||||
{
|
||||
double const delta = CalculateDeltaMeters(GetCheckpoint(points, i),
|
||||
GetCheckpoint(points, i + 1), point);
|
||||
double const delta = CalculateDeltaMeters(GetCheckpoint(points, i), GetCheckpoint(points, i + 1), point);
|
||||
if (minDeltaMeters > delta)
|
||||
{
|
||||
minDeltaMeters = delta;
|
||||
@@ -43,8 +40,7 @@ size_t CheckpointPredictor::PredictPosition(vector<m2::PointD> const & points,
|
||||
return minDeltaIdx;
|
||||
}
|
||||
|
||||
m2::PointD const & CheckpointPredictor::GetCheckpoint(vector<m2::PointD> const & points,
|
||||
size_t index) const
|
||||
m2::PointD const & CheckpointPredictor::GetCheckpoint(vector<m2::PointD> const & points, size_t index) const
|
||||
{
|
||||
if (index == 0)
|
||||
return m_start;
|
||||
|
||||
Reference in New Issue
Block a user