File:Наклоненное дерево Пифагора.png

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

Наклоненное_дерево_Пифагора.png(690 × 488 pixels, file size: 115 KB, MIME type: image/png)

Captions

Captions

Thick tilted tree of Pythagoras

Summary

[edit]
Description
Русский: Наклоненное дерево Пифагора
English: Thick tilted tree of Pythagoras
Date
Source Own work
Author Владислав Молдован

pascal src code

[edit]
  • Size - original side length of the square
  • RotationAngle - branch angle
uses GraphABC;
const
  Size = 100;
  RotationAngle = 50;

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

procedure Draw(x, y, r, angle: real);
begin
  var ang1 := DegToRad(angle + 90);
  var x1 := x + r * Cos(ang1);
  var y1 := y + r * Sin(ang1);
  
  var ang2 := DegToRad(angle);
  var x2 := x1 + r * Cos(ang2);
  var y2 := y1 + r * Sin(ang2);
  
  var ang3 := DegToRad(angle - 90);
  var x3 := x2 + r * Cos(ang3);
  var y3 := y2 + r * Sin(ang3);
  
  var r2 := r * Cos(DegToRad(RotationAngle));
  var r3 := r * Cos(DegToRad(90 - RotationAngle));
  
  var ang4 := DegToRad(angle - RotationAngle);
  var x4 := x + r2 * Cos(ang4);
  var y4 := y + r2 * Sin(ang4);
  
  RLine(x, y, x1, y1);
  RLine(x1, y1, x2, y2);
  RLine(x2, y2, x3, y3);
  RLine(x3, y3, x, y);
  RLine(x, y, x4, y4);
  RLine(x4, y4, x3, y3);
  
  if r > 1 then
  begin
    var ang5 := DegToRad(angle - 90 - RotationAngle);
    Draw(x + r2 * Cos(ang5), y + r2 * Sin(ang5), r2, angle - RotationAngle);
    
    var ang6 := DegToRad(angle - RotationAngle);
    Draw(x4 + r3 * Cos(ang6), y4 + r3 * Sin(ang6), r3, angle + 90 - RotationAngle);
  end;
end;

begin
  LockDrawing();
  MaximizeWindow();
  Draw(Window.Width / 2 - Size / 2, Window.Height / 2 + 200, Size, 0);
  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 2017690 × 488 (115 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