Index: trunk/Mars/msimreflector/MFresnelLens.cc
===================================================================
--- trunk/Mars/msimreflector/MFresnelLens.cc	(revision 19607)
+++ trunk/Mars/msimreflector/MFresnelLens.cc	(revision 19608)
@@ -103,5 +103,5 @@
 
    // Radius at distance z+dz from the tip and at distance r from the axis of the cone
-   // r = (z-dz) * tan(theta)
+   // r = (z+dz) * tan(theta)
 
    // Defining
@@ -124,7 +124,7 @@
    // (dz*u.x+p.x)^2 + (dz*u.y+p.y)^2 = (z-dz)^2 * tan(theta)^2
    //
-   // dz^2*ux^2 + px^2 + 2*dz*ux*px + dz^2*uy^2 + py^2 + 2*dz*uy*py = (z^2*tan(theta)^2 + dz^2*tan(theta)^2 - 2*z*dz*tan(theta)^2
+   // dz^2*ux^2 + px^2 + 2*dz*ux*px + dz^2*uy^2 + py^2 + 2*dz*uy*py = (z^2*tan(theta)^2 + dz^2*tan(theta)^2 + 2*z*dz*tan(theta)^2
    //
-   // dz^2*(ux^2 + uy^2 - tan(theta)^2)  +  2*dz*(ux*px + uy*py + z*tan(theta)^2)  +  (px^2+py^2 - z^2*tan(theta)^2)  =  0
+   // dz^2*(ux^2 + uy^2 - tan(theta)^2)  +  2*dz*(ux*px + uy*py - z*tan(theta)^2)  +  (px^2+py^2 - z^2*tan(theta)^2)  =  0
 
    // t   := tan(theta)
@@ -137,5 +137,5 @@
 
     const double a = u.R2()                    - g.fTanTheta2[0];
-    const double B = u.XYvector()*p.XYvector() + g.fTanTheta2[1];
+    const double B = u.XYvector()*p.XYvector() - g.fTanTheta2[1];
     const double c = p.R2()                    - g.fTanTheta2[2];
 
@@ -266,6 +266,6 @@
     const double theta = atan(so / (1-sqrt(n0*n0 - so*so)));
 
-    //             theta                   peak_z (defined positive)
-    const Groove g(TMath::Pi()/2 + theta, -r0*tan(theta));
+    //             theta                   peak_z
+    const Groove g(TMath::Pi()/2 + theta, r0*tan(theta));
 
     // Calculate the insersection between the ray and the cone
