Files
Upsilon/kandinsky/src/point.cpp
Léa Saviot fc8cd6c06e [expression_editor/poincare] Move Up in an ExpressionLayout.
Change-Id: I75fd91233729afd4eb77d8e9d53c102a632643ea
2018-01-15 11:58:01 +01:00

14 lines
345 B
C++

#include <kandinsky/point.h>
KDPoint KDPoint::translatedBy(KDPoint other) const {
return KDPoint(m_x+other.x(), m_y+other.y());
}
KDPoint KDPoint::opposite() const {
return KDPoint(-m_x, -m_y);
}
uint16_t KDPoint::squareDistanceTo(KDPoint other) const {
return (m_x-other.x()) * (m_x-other.x()) + (m_y-other.y()) * (m_y-other.y());
}