From 3d4c3356183686b97e8fa750b73ce727a59ff89f Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 27 Apr 2010 00:17:22 +0200 Subject: digital/avr/modules/math/geometry: add distance_point_point --- digital/avr/modules/math/geometry/test/test_geometry.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'digital/avr/modules/math/geometry/test') diff --git a/digital/avr/modules/math/geometry/test/test_geometry.c b/digital/avr/modules/math/geometry/test/test_geometry.c index 90c063bc..17afb787 100644 --- a/digital/avr/modules/math/geometry/test/test_geometry.c +++ b/digital/avr/modules/math/geometry/test/test_geometry.c @@ -197,6 +197,19 @@ test_distance (void) { vect_t a, b, p; int16_t d; + /* distance_point_point. */ + a.x = 100; a.y = 100; + b.x = 200; b.y = 200; + d = distance_point_point (&a, &b); + test (d == 141); + a.x = -100; a.y = -100; + b.x = -200; b.y = -200; + d = distance_point_point (&a, &b); + test (d == 141); + a.x = 0; a.y = -100; + b.x = 0; b.y = 200; + d = distance_point_point (&a, &b); + test (d == 300); /* distance_segment_point. */ a.x = 300; a.y = 200; b.x = 900; b.y = 500; -- cgit v1.2.3