File:Треугольник Серпинского.png

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

Треугольник_Серпинского.png(501 × 500 pixels, file size: 16 KB, MIME type: image/png)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Sierpinski triangle
Русский: Треугольник Серпинского
Date
Source Own work
Author Владислав Молдован

Pascal src code[edit]

uses GraphABC;

procedure RLine(x, y, x1, y1: real) := Line(Round(x), Round(y), Round(x1), Round(y1));

procedure Draw(x, y, x1, y1, x2, y2: real; iterations: integer);
begin
  if iterations > 0 then
  begin
    var mx1 := (x + x1) / 2;
    var my1 := (y + y1) / 2;
    var mx2 := (x1 + x2) / 2;
    var my2 := (y1 + y2) / 2;
    var mx3 := (x2 + x) / 2;
    var my3 := (y2 + y) / 2;
    
    Dec(iterations);
    Draw(x, y, mx1, my1, mx3, my3, iterations);
    Draw(mx1, my1, x1, y1, mx2, my2, iterations);
    Draw(mx3, my3, mx2, my2, x2, y2, iterations);
  end
  else
  begin
    RLine(x, y, x1, y1);
    RLine(x1, y1, x2, y2);
    RLine(x2, y2, x, y);
  end;
end;

begin
  Lockdrawing();
  Draw(100, 500, 100, 100, 500, 500, 8);
  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 2017501 × 500 (16 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