aboutsummaryrefslogtreecommitdiff
path: root/tools/lighthousefind_tori/main.c
diff options
context:
space:
mode:
authorMike Turvey <mturvey6@gmail.com>2017-02-15 22:55:23 -0700
committermwturvey <michael.w.turvey@intel.com>2017-02-21 13:29:40 -0700
commitbb099f0fd084c3a2f84532e76928a4f548bf188e (patch)
treec60853c2811b8caca2d66b619a5dc60c79df82b8 /tools/lighthousefind_tori/main.c
parent93873b616394b24fefb0ce17ae0e302ff2697d14 (diff)
downloadlibsurvive-bb099f0fd084c3a2f84532e76928a4f548bf188e.tar.gz
libsurvive-bb099f0fd084c3a2f84532e76928a4f548bf188e.tar.bz2
Eliminate unnecessary pow calls.
Diffstat (limited to 'tools/lighthousefind_tori/main.c')
-rw-r--r--tools/lighthousefind_tori/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/lighthousefind_tori/main.c b/tools/lighthousefind_tori/main.c
index ee56b37..e94268c 100644
--- a/tools/lighthousefind_tori/main.c
+++ b/tools/lighthousefind_tori/main.c
@@ -64,7 +64,18 @@ static void runTheNumbers()
printf("Using %d sensors to find lighthouse.\n", sensorCount);
- Point lh = SolveForLighthouse(to, 1);
+ Point lh;
+ for (int i = 0; i < 200; i++)
+ {
+ lh = SolveForLighthouse(to, 0);
+ //(0.156754, -2.403268, 2.280167)
+ assert(fabs((lh.x / 0.156754) - 1) < 0.00001);
+ assert(fabs((lh.y / -2.403268) - 1) < 0.00001);
+ assert(fabs((lh.z / 2.280167) - 1) < 0.00001);
+ assert(lh.x > 0);
+ assert(lh.y < 0);
+ assert(lh.z > 0);
+ }
printf("(%f, %f, %f)\n", lh.x, lh.y, lh.z);