void Path(Painter& sw) { sw.Translate(52, 52); for(int i = 0; i < 2; i++) { sw.Rectangle(20, 20, 60, 60); sw.Move(0, 0); sw.Cubic(99, 0, 50, 50, 99, 99); sw.Cubic(0, 99, 50, 50, 0, 0); sw.EvenOdd(i).Fill(Green()); sw.Stroke(1, Black()); sw.Translate(120, 0); } }
void BigStroke(Painter& sw) { int n = 0; double r = 400; int i = 0; while(r > 5) { Pointf p = Polar(i * M_2PI / 400) * r + Pointf(400, 400); if(i) sw.Line(p); else sw.Move(p); sw.Line(Polar((i * M_2PI / 400 + M_2PI / 800)) * (r - 3) + Pointf(400, 400)); n += 2; r = r - 0.01; i++; } sw.Stroke(1, Black()); sw.Text(0, 0, "Elements: " + AsString(n), Arial(20)).Fill(Blue()); }