File:Папоротники.png

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

Папоротники.png(636 × 351 pixels, file size: 33 KB, MIME type: image/png)

Captions

Captions

Barnsley fern

Summary[edit]

Description
Русский: Папоротники
English: Barnsley ferns
Date
Source Own work
Author Владислав Молдован

Pascal src code[edit]

uses GraphABC; 
const
  Rotate = 40;

var
  Ang: integer;

procedure Draw(x, y, l, angle: real; s: integer; toRight: boolean);
begin
  var ang1 := DegToRad(angle);
  var cx := x + l * Cos(ang1); 
  var cy := y + l * Sin(ang1); 
  
  SetPenWidth(s);
  Line(Round(x), Round(y), Round(cx), Round(cy));
  if l > 1 then 
  begin
    var l2 := l * 0.7; 
    l := l * 0.5; 
    if s > 1 then Dec(s);
    
    var ang2 := angle + Ang;
    var ang3 := angle - Ang;
    if toRight then 
    begin
      Draw(cx, cy, l2, ang2, s, toRight); 
      Draw(cx, cy, l, ang2 + Rotate, s, toRight); 
      Draw(cx, cy, l, ang3 - Rotate, s, toRight); 
    end 
    else 
    begin
      Draw(cx, cy, l2, ang3, s, toRight); 
      Draw(cx, cy, l, ang2 + Rotate, s, toRight); 
      Draw(cx, cy, l, ang3 - Rotate, s, toRight); 
    end; 
  end; 
end;

var
  ToRight: boolean;

begin
  var W := Window.Width; 
  var H := Window.Height; 
  
  SetWindowIsFixedSize(true); 
  ClearWindow(clBlack);
  LockDrawing();
  
  SetSmoothingOff();
  
  var X := 0; 
  var N := 5; 
  for var i := 0 to 10 do 
  begin
    var j := Random(60);
    if j mod 2 = 0 then ToRight := true else ToRight := false; 
    
    j := Random(2); 
    case j of 
      0: SetPenColor(clPink); 
      1: SetPenColor(clRed); 
    end;
    
    Ang := Random(20); 
    Draw(X + Random(10), H + Random(10), Random(100), -90, 3, ToRight); 
    Inc(X, W div (N + 1)); 
  end;
  Redraw();
end.

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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current14:14, 1 September 2017Thumbnail for version as of 14:14, 1 September 2017636 × 351 (33 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