Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- largeRadius = 600;
- smallRadius = 299;
- stepSize = 0.1;
- radiusDif = largeRadius - smallRadius;
- var
- step, maxStep: Extended;
- smallTheta, largeTheta, x, y: Extended;
- graph: array [-largeRadius..largeRadius] of array [-largeRadius..largeRadius] of Boolean;
- bit, a, b: Integer;
- function GetFactor(a, b: Integer): Integer;
- var
- f, l: Integer;
- begin
- Result := a * b;
- f := 2;
- repeat
- if ((a mod f) = 0) then
- if ((b mod f) = 0) then
- begin
- a := a div f;
- b := b div f;
- Result := Result div f;
- Continue;
- end;
- f := f + 1;
- l := Min(a, b);
- until (f > l);
- end;
- begin
- step := -stepSize;
- maxStep := GetFactor(largeRadius, smallRadius) * 2 * Pi;
- repeat
- step := step + stepSize;
- largeTheta := (step / (largeRadius * 1.0));
- smallTheta := (step / (smallRadius * 1.0));
- x := (radiusDif * Cos(largeTheta)) + (smallRadius * Cos(smallTheta));
- y := (radiusDif * Sin(largeTheta)) + (smallRadius * Sin(smallTheta));
- graph[Round(y)][Round(x)] := True;
- until (step > maxStep);
- DisplayDebugImgWindow(largeRadius * 2 + 1, largeRadius * 2 + 1);
- bit := CreateBitmap(largeRadius * 2 + 1, largeRadius * 2 + 1);
- FastDrawClear(bit, clWhite);
- DrawBitmapDebugImg(bit);
- for a := -largeRadius to largeRadius do
- for b := -largeRadius to largeRadius do
- if (graph[a][b]) then
- FastSetPixel(bit, b + largeRadius, a + largeRadius, clRed);
- DrawBitmapDebugImg(bit);
- SaveBitmap(bit, AppPath + 'maow.bmp');
- FreeBitmap(bit);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement