summaryrefslogtreecommitdiff
path: root/digital/avr/modules/math/geometry/test/test_geometry.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/avr/modules/math/geometry/test/test_geometry.c')
-rw-r--r--digital/avr/modules/math/geometry/test/test_geometry.c13
1 files changed, 13 insertions, 0 deletions
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;