Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1866)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1867)
@@ -152,5 +152,8 @@
     const float delta = h.GetDelta();
 
-    const float m = tan(delta);
+    const float m    = tan(delta);
+    const float cosd = 1.0/sqrt(1.0+m*m);
+    const float sind = sqrt(1.0-cosd*cosd);
+
 
     float t = h.GetMeanY() - m*h.GetMeanX();
@@ -159,15 +162,22 @@
         t *= fMm2Deg;
 
+    // get step size ds along the main axis of the ellipse
+    TAxis &axe = *fStarMap->GetXaxis();
+    const int   N    = axe.GetNbins();
+    const float xmin = axe.GetBinLowEdge(1);
+    const float xmax = axe.GetBinLowEdge(N+1);
+    const float ds   = (xmax-xmin) / 200.0;
+
     if (m>-1 && m<1)
     {
-        TAxis &axe = *fStarMap->GetXaxis();
-
-        const int N = axe.GetXbins()->GetSize();
-        for (int i=0; i<N; i++)
+        float dx = ds * cosd;
+        float  x = xmin + dx/2.0;
+        int   N1 = (int) ((xmax-xmin)/dx+1.0);
+
+        for (int i=0; i<N1; i++)
         {
-            const float x = axe.GetBinCenter(i);
             const float y = m*x+t;
-
             fStarMap->Fill(x, y);
+            x += dx;
         }
     }
@@ -175,12 +185,17 @@
     {
         TAxis &axe = *fStarMap->GetYaxis();
-
-        const int N = axe.GetXbins()->GetSize();
-        for (int i=0; i<N; i++)
+        const int   M    = axe.GetNbins();
+        const float ymin = axe.GetBinLowEdge(1);
+        const float ymax = axe.GetBinLowEdge(M+1);
+
+        float dy = ds * sind;
+        float  y = ymin + dy/2.0;
+        int   M1 = (int) ((ymax-ymin)/dy+1.0);
+
+        for (int i=0; i<M1; i++)
         {
-            const float y = axe.GetBinCenter(i);
             const float x = (y-t)/m;
-
             fStarMap->Fill(x, y);
+            y += dy;
         }
     }
