mirror-chatterino2/src/util/distancebetweenpoints.hpp
2017-06-11 09:31:45 +02:00

21 lines
352 B
C++

#pragma once
#include <math.h>
namespace chatterino {
namespace util {
static float distanceBetweenPoints(const QPointF &p1, const QPointF &p2)
{
QPointF tmp = p1 - p2;
float distance = 0.f;
distance += tmp.x() * tmp.x();
distance += tmp.y() * tmp.y();
return sqrt(distance);
}
} // namespace util
} // namespace chatterino