File:Снежинка Коха2.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Снежинка_Коха2.png (496 × 493 pixels, file size: 23 KB, MIME type: image/png)
File information
Structured data
Captions
Summary[edit]
DescriptionСнежинка Коха2.png |
English: Koch snowflake English: Снежинка Коха2 |
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));
function GetAngle(x, y, x2, y2: real): real;
begin
var angle := Abs(RadToDeg(ArcTan((y2 - y) / (x2 - x))));
if (x2 = x) and (y2 = y) then
Result := 0
else
if x2 > x then
if y2 > y then Result := angle else Result := 360 - angle
else
if y2 > y then Result := 180 - angle else Result := 180 + angle;
end;
function Distance(x, y, x1, y1: real) := Sqrt(Sqr(x1 - x) + Sqr(y1 - y));
procedure Draw(x, y, x1, y1: real);
begin
if Distance(x, y, x1, y1) > 1 then
begin
var dx := (x1 - x) / 3;
var dy := (y1 - y) / 3;
var x2 := x + dx;
var y2 := y + dy;
var angle := DegToRad(GetAngle(x, y, x1, y1) - 60);
var r := Distance(x, y, x2, y2);
var x3 := x2 + r * Cos(angle);
var y3 := y2 + r * Sin(angle);
var x4 := x + dx * 2;
var y4 := y + dy * 2;
Draw(x, y, x2, y2);
Draw(x2, y2, x3, y3);
Draw(x3, y3, x4, y4);
Draw(x4, y4, x1, y1);
end
else
RLine(x, y, x1, y1);
end;
begin
SetWindowSize(500, 500);
SetWindowIsFixedSize(true);
ClearWindow(clBlack);
LockDrawing();
SetPenColor(clCyan);
Draw(100, 100, 400, 100);
Draw(400, 100, 400, 400);
Draw(400, 400, 100, 400);
Draw(100, 400, 100, 100);
Redraw();
end.
Licensing[edit]
I, the copyright holder of this work, hereby publish it under the following license:
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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:02, 17 September 2017 | 496 × 493 (23 KB) | Владислав Молдован (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ru.wikibooks.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 37.78 dpc |
---|---|
Vertical resolution | 37.78 dpc |