Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- largeRadius = 100;
- smallRadius = 50;
- largeLim = largeRadius * largeRadius;
- smallLim = smallRadius * smallRadius;
- imgSize = 400;
- cen = imgSize div 2;
- var
- b, x, a, y, c: Integer;
- u: Boolean;
- begin
- DisplayDebugImgWindow(imgSize, imgSize);
- b := BitmapFromString(imgSize, imgSize, '');
- a := 0;
- u := True;
- for c := 0 to largeLim do
- begin
- if (u) then
- Inc(a)
- else
- Dec(a);
- if (u) then
- x := Round(Sqrt(c) + Sqrt(a))
- else
- x := Round(Sqrt(c) - Sqrt(a));
- y := Round(Sqrt(largeLim - c) + Sqrt(smallLim - a));
- FastSetPixel(b, cen + x, cen - y, clRed);
- FastSetPixel(b, cen + x, cen + y, clRed);
- FastSetPixel(b, cen - x, cen + y, clRed);
- FastSetPixel(b, cen - x, cen - y, clRed);
- y := Round(Sqrt(largeLim - c) - Sqrt(smallLim - a));
- FastSetPixel(b, cen + x, cen - y, clRed);
- FastSetPixel(b, cen + x, cen + y, clRed);
- FastSetPixel(b, cen - x, cen + y, clRed);
- FastSetPixel(b, cen - x, cen - y, clRed);
- if (not InRange(a, 1, 2499)) then
- u := not u;
- end;
- DrawBitmapDebugImg(b);
- end.
Add Comment
Please, Sign In to add comment