aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libsample/point.cpp')
-rw-r--r--tests/libsample/point.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/libsample/point.cpp b/tests/libsample/point.cpp
index 484e7c11c..61e2830e4 100644
--- a/tests/libsample/point.cpp
+++ b/tests/libsample/point.cpp
@@ -33,6 +33,15 @@ Point::Point(double x, double y) : m_x(x), m_y(y)
{
}
+void
+Point::midpoint(const Point& other, Point* midpoint) const
+{
+ if (!midpoint)
+ return;
+ midpoint->setX((m_x + other.m_x) / 2.0);
+ midpoint->setY((m_y + other.m_y) / 2.0);
+}
+
Point*
Point::copy() const
{