File:Комок шерсти.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Комок_шерсти.png(637 × 477 pixels, file size: 363 KB, MIME type: image/png)

Captions

Captions

ball of wool

Summary

[edit]
Description
Русский: Комок шерсти
English: ball of wool
Date
Source Own work
Author Владислав Молдован

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Pascal src code

[edit]
  • Rotation - angle of rotation
  • MinAngle - минимальный угол для поворота отрезка
  • MaxAngle - minimum angle for segment rotation
  • RandomAngle - the maximum value that a random angle can take modulo
  • AngleCount - number of corners
uses GraphABC;
const
  Rotation = 15;
  MinAngle = -400;
  MaxAngle = 400;
  RandomAngle = 10;
  MaxT = 5;
  AngleCount = 10;

procedure Draw(x, y, r, angle: real; n: integer);
begin
  var ang := DegToRad(angle);
  var x1 := x + r * Cos(ang);
  var y1 := y + r * Sin(ang);
  
  SetPenWidth(n);
  Line(Round(x), Round(y), Round(x1), Round(y1));
  
  if r > 8 then
  begin
    r := r * 0.8;
    if n > 0 then n := n - 1;
    if angle + Rotation < MaxAngle then
      Draw(x1, y1, r, angle + Rotation + Random(-RandomAngle, RandomAngle), n);
    if angle - Rotation > MinAngle then
      Draw(x1, y1, r, angle - Rotation - Random(-RandomAngle, RandomAngle), n);
  end;
end;

begin
  ClearWindow(clBlack);
  SetWindowIsFixedSize(true);
  
  var R := 50;
  var PosX := Window.Width div 2;
  var PosY := Window.Height div 2;
  
  LockDrawing();
  while R > 0 do
  begin
    var c := clRandom();
    SetPenColor(ARGB(50, c.R, c.G, c.B));
    for var i := 0 to AngleCount - 1 do
      Draw(PosX, PosY, R, (360 / AngleCount) * i, 1);
    Dec(R, 2);
  end;
  Redraw();
end.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:32, 1 September 2017Thumbnail for version as of 09:32, 1 September 2017637 × 477 (363 KB)Владислав Молдован (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata