Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Chaos-game/Maple/chaos-game.maple
Normal file
18
Task/Chaos-game/Maple/chaos-game.maple
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
chaosGame := proc(numPoints)
|
||||
local points, i;
|
||||
randomize();
|
||||
use geometry in
|
||||
RegularPolygon(triSideways, 3, point(cent, [0, 0]), 1);
|
||||
rotation(tri, triSideways, Pi/2, counterclockwise);
|
||||
randpoint(currentP, -1/2*sqrt(3)..1/2*sqrt(3), -1/2..1/2);
|
||||
points := [coordinates(currentP)];
|
||||
for i to numPoints do
|
||||
midpoint(mid, currentP, parse(cat("rotate_triSideways_", rand(1..3)(), "_tri")));
|
||||
points := [op(points), coordinates(mid)];
|
||||
point(currentP, coordinates(mid));
|
||||
end do:
|
||||
end use;
|
||||
use plottools in
|
||||
plots:-display( seq([plots:-display([seq(point(points[i]), i = 1..j)])], j = 1..numelems(points) ), insequence=true);
|
||||
end use;
|
||||
end proc:
|
||||
Loading…
Add table
Add a link
Reference in a new issue