Jump to content

Kronecker product based fractals: Difference between revisions

no edit summary
imported>Maxima enthusiast
No edit summary
Line 2,742:
{{out}}
Outputs three graphical visualisations of the three 4th order products.
 
=={{header|Maxima}}==
Using function definide in Kronecker product task page
<syntaxhighlight lang="maxima">
pow_kron(matr,n):=block(MATR:copymatrix(matr),
for i from 1 thru n do MATR:altern_kronecker(matr,MATR),
MATR);
 
/* Examples */
A:matrix([0,1,0],[1,1,1],[0,1,0])$
B:matrix([1,1,1],[1,0,1],[1,1,1])$
 
pow_kron(A,3)$
at(%,[0="",1="x"]);
 
pow_kron(B,3)$
at(%,[0="",1="x"]);
</syntaxhighlight>
{{out}}
<pre>
[[File:Vicsek.png|thumb|Vicsek fractal]]
 
[[File:SierpinskiCarpet.png|thumb|Sierpinski carpet fractal]]
</pre>
 
=={{header|Nim}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.