Beispiel #1
0
 public void UpdateRing()
 {
     if (!double.IsNaN(Radius) && Radius > 0 && Center != null && PointCount > 2)
     {
         PointCollection pnts = new PointCollection();
         for (int i = PointCount; i >= 0; i--)
         {
             double rad = 2 * Math.PI / PointCount * i;
             double x   = Math.Cos(rad) * Radius + Center.X;
             double y   = Math.Sin(rad) * Radius + Center.Y;
             pnts.Add(new MapPoint(x, y));
         }
         if (Rings.Count == 0)
         {
             Rings.Add(pnts);
         }
         else
         {
             Rings[0] = pnts;
         }
     }
     else
     {
         Rings.Clear();
     }
 }