changeset 176:ab9c799f5de1 wasm

fix interpolation with negative coordinates
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Mar 2018 10:06:59 +0100
parents 15d92d93738b
children 83200c4d07ca
files UnitTestsSources/UnitTestsMain.cpp
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/UnitTestsSources/UnitTestsMain.cpp	Fri Mar 09 10:06:40 2018 +0100
+++ b/UnitTestsSources/UnitTestsMain.cpp	Fri Mar 09 10:06:59 2018 +0100
@@ -140,10 +140,24 @@
   ASSERT_FLOAT_EQ(146.1f, OrthancStone::GeometryToolbox::ComputeBilinearInterpolation
                   (20.5f, 14.2f, 91, 210, 162, 95));
 
+  ASSERT_NEAR(146.1f, OrthancStone::GeometryToolbox::ComputeBilinearInterpolation
+              (-20.5f, 14.2f, 91, 210, 162, 95), 0.0001f);
+
+  ASSERT_NEAR(146.1f, OrthancStone::GeometryToolbox::ComputeBilinearInterpolation
+              (-20.5f, -8.8f, 91, 210, 162, 95), 0.0001f);
+
+  ASSERT_NEAR(146.1f, OrthancStone::GeometryToolbox::ComputeBilinearInterpolation
+              (20.5f, -8.8f, 91, 210, 162, 95), 0.0001f);
+
   ASSERT_FLOAT_EQ(123.35f, OrthancStone::GeometryToolbox::ComputeTrilinearInterpolation
                   (20.5f, 15.2f, 5.7f,
                    91, 210, 162, 95,
                    51, 190, 80, 92));
+
+  ASSERT_FLOAT_EQ(123.35f, OrthancStone::GeometryToolbox::ComputeTrilinearInterpolation
+                  (20.5f, 15.2f, -6.3f,
+                   91, 210, 162, 95,
+                   51, 190, 80, 92));
 }