Ejemplo n.º 1
0
 public IEnumerable <PointF> GetSpiralPoints()
 {
     for (float theta = 0; ; theta += deltaAngle)
     {
         var   r = thickness * theta;
         float x, y;
         (x, y) = PointConverter.TransformPolarToCartesian(r, theta);
         x     += center.X;
         y     += center.Y;
         yield return(new PointF(x, y));
     }
 }
Ejemplo n.º 2
0
 private bool TryFindPointAtSpiralOneSpinAgo(PointF currentSpinPoint, float a, out PointF previousSpinPoint)
 {
     var(r, theta) =
         PointConverter.TransformCartesianToPolar(currentSpinPoint.X - center.X, currentSpinPoint.Y - center.Y);
     theta -= (float)(2 * Math.PI * a);
     if (theta < 0)
     {
         previousSpinPoint = new PointF(0, 0);
         return(false);
     }
     r                 = theta * a;
     var(x, y)         = PointConverter.TransformPolarToCartesian(r, theta);
     previousSpinPoint = new PointF(x + center.X, y + center.Y);
     return(true);
 }