Pythagoras tree: Difference between revisions
Content deleted Content added
m →{{header|Rust}}: Used features of rust version 1.58.0 for println!() |
|||
Line 423: | Line 423: | ||
x5 = x4 + 0.5 * (dx - dy) |
x5 = x4 + 0.5 * (dx - dy) |
||
y5 = y4 - 0.5 * (dx + dy) |
y5 = y4 - 0.5 * (dx + dy) |
||
color3 0.3 0.2 + depth / 18 0.1 |
|||
polygon [ x1 y1 x2 y2 x3 y3 x4 y4 ] |
|||
polygon [ x3 y3 x4 y4 x5 y5 ] |
|||
call tree x4 y4 x5 y5 depth + 1 |
call tree x4 y4 x5 y5 depth + 1 |
||
call tree x5 y5 x3 y3 depth + 1 |
call tree x5 y5 x3 y3 depth + 1 |
||
. |
. |
||
. |
. |
||
color3 0.3 0 0.1 |
|||
call tree 41 90 59 90 0</lang> |
call tree 41 90 59 90 0</lang> |
||