Pythagoras tree: Difference between revisions
m
→{{header|Dart}}: cosmetics
m (→{{header|Wren}}: Changed to Wren S/H) |
m (→{{header|Dart}}: cosmetics) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 453:
final (a, b) = pp;
final v = Point((b - a).y, (a - b).x);
final
basis.addAll([(c, e), (e, d)]);
return '<polygon points="${[a, c, e, d, c, d, b].expand((p) => [p.x, p.y]).join(' ')}"/>';
Line 491 ⟶ 490:
for (var (a, b) in basis0) {
final v = Offset((b - a).dy, (a - b).dx);
final
basis.addAll([(c, e), (e, d)]);
path.addPolygon([a, c, e, d, c, d, b], true);
Line 1,041 ⟶ 1,039:
</html></syntaxhighlight>
==={{trans|Rust}}===
[[File:
Run this script from the browser console (F12) or from the <script> tag of an html document.
<syntaxhighlight lang="javascript">let base = [[{ x: -200, y: 0 }, { x: 200, y: 0 }]];
Line 2,098 ⟶ 2,096:
=={{header|Rust}}==
Creates a '''[https://gist.githubusercontent.com/vvshard/833bd69acfa9160350cdbc9b57bbefe4/raw/pythagoras_tree.svg svg file]''' (12 levels) <br>
[[File:
'''[dependencies]'''<br>
|