Pythagoras tree: Difference between revisions

m
m (→‎{{trans|Rust}}: Image restoration)
m (→‎{{header|Dart}}: cosmetics)
 
Line 453:
final (a, b) = pp;
final v = Point((b - a).y, (a - b).x);
final ([c, d), e] = [a, b, (a + b + v,) b* 0.5].map((p) => p + v).toList();
final e = (c + d + v) * 0.5;
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 ([c, d), e] = [a, b, (a + b + v,) b/ 2].map((p) => p + v).toList();
final e = (c + d + v) / 2;
basis.addAll([(c, e), (e, d)]);
path.addPolygon([a, c, e, d, c, d, b], true);
106

edits