Fixed a roundoff error in Triangle's contains algorithm.
Fixed a roundoff error in Triangle's contains algorithm.

file:a/Scene.cpp -> file:b/Scene.cpp
--- a/Scene.cpp
+++ b/Scene.cpp
@@ -161,9 +161,7 @@
 
   for(int x=0;x<_camera.width();x++)
     for(int y=0;y<_camera.height();y++)
-      {
-	ppm.setPixel(x,y,computePixel(x,y));
-      }
+      ppm.setPixel(x,y,computePixel(x,y));
   
   //Test the middle point
   /*unsigned int x=_camera.width()/2;
@@ -176,8 +174,8 @@
     ppm.setPixel(x,y,computePixel(x,y));*/
   
   // Test random point
-  /*unsigned int x=100;
-  unsigned int y=50;
+  /*unsigned int x=153;
+  unsigned int y=104;
   ppm.setPixel(x,y,computePixel(x,y));*/
   
   ppm.save(output);
@@ -355,10 +353,7 @@
 	  overallColor+=transmittedColor;
 	}
 	  
-      /*printf("overallColor=(%f\t%f\t%f)\n"
-	     ,overallColor.r()
-	     ,overallColor.g()
-	     ,overallColor.b());*/
+      //std::cout << "overallColor=" << (std::string)overallColor << std::endl;
       return overallColor;
     }
   

--- a/Triangle.cpp
+++ b/Triangle.cpp
@@ -53,11 +53,10 @@
 
   double a=ab.x();
   double b=ab.y();
-  
-  if(a<0 || a>1) // Not inside triangle
+  if(a<-EPSILON || a>1+EPSILON) // Not inside triangle
     return false;
 
-  if(b<0 || b>1) // Not inside triangle
+  if(b<-EPSILON || b>1+EPSILON) // Not inside triangle
     return false;
 
   return true;

Binary files a/tests/refractiontest.png and b/tests/refractiontest.png differ