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

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

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

Captions

Captions

Barnsley fern

Summary

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

Pascal src code

[edit]
  • Rotate - angle of rotation of one branch relative to another
  • MaxAng - maximum tilt angle
uses GraphABC; 
const
  Rotate = 50;
  MaxAng = 10;

var
  Ang: integer;

procedure Draw(x, y, l, angle: real; s: integer);
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.72; 
    l := l * 0.5;
    
    if s > 1 then Dec(s);
    var ang3 := angle + Ang;
    Draw(cx, cy, l2, ang3, s); 
    Draw(cx, cy, l, ang3 + Rotate, s); 
    Draw(cx, cy, l, ang3 - Rotate, s); 
  end; 
end;


begin
  var W := Window.Width / 2;
  var H := Window.Height;
  
  SetPenColor(clDarkGreen); 
  SetSmoothingOff(); 
  
  LockDrawing();
  while true do
  begin
    for Ang := -MaxAng to MaxAng do
    begin
      ClearWindow();
      Draw(W, H, 100, -90, 2);
      Redraw();
    end;
    for Ang := MaxAng downto -MaxAng do
    begin
      ClearWindow();
      Draw(W, H, 100, -90, 2);
      Redraw();
    end;
  end;
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 2017421 × 375 (18 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