Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,17 +1,17 @@
|
|||
Subroutine pythagoras_tree(x1, y1, x2, y2, depth)
|
||||
If depth > 10 Then Return
|
||||
If depth > 10 Then Return
|
||||
|
||||
dx = x2 - x1 : dy = y1 - y2
|
||||
x3 = x2 - dy : y3 = y2 - dx
|
||||
x4 = x1 - dy : y4 = y1 - dx
|
||||
x5 = x4 + (dx - dy) / 2
|
||||
y5 = y4 - (dx + dy) / 2
|
||||
#draw the box
|
||||
Line x1, y1, x2, y2 : Line x2, y2, x3, y3
|
||||
Line x3, y3, x4, y4 : Line x4, y4, x1, y1
|
||||
dx = x2 - x1 : dy = y1 - y2
|
||||
x3 = x2 - dy : y3 = y2 - dx
|
||||
x4 = x1 - dy : y4 = y1 - dx
|
||||
x5 = x4 + (dx - dy) / 2
|
||||
y5 = y4 - (dx + dy) / 2
|
||||
#draw the box
|
||||
Line x1, y1, x2, y2 : Line x2, y2, x3, y3
|
||||
Line x3, y3, x4, y4 : Line x4, y4, x1, y1
|
||||
|
||||
Call pythagoras_tree(x4, y4, x5, y5, depth +1)
|
||||
Call pythagoras_tree(x5, y5, x3, y3, depth +1)
|
||||
Call pythagoras_tree(x4, y4, x5, y5, depth +1)
|
||||
Call pythagoras_tree(x5, y5, x3, y3, depth +1)
|
||||
End Subroutine
|
||||
|
||||
w = 800 : h = w * 11 \ 16
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue