|
Size: 7375
Comment: modified "exploring mandelbrot": faster and more intuitive
|
Size: 8292
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 8: | Line 8: |
| {{{ | {{{#!sagecell |
| Line 45: | Line 45: |
| {{{ | {{{#!sagecell |
| Line 69: | Line 69: |
| {{{ | {{{#!sagecell |
| Line 91: | Line 91: |
| == Now in 3d == {{{ |
== Now in 3D == {{{#!sagecell |
| Line 125: | Line 125: |
| {{{ | {{{#!sagecell |
| Line 137: | Line 137: |
| cdef np.ndarray[int, ndim=2] m m = np.zeros((N,N), dtype=int) |
cdef np.ndarray[np.uint16_t, ndim=2] m m = np.zeros((N,N), dtype=np.uint16) |
| Line 154: | Line 154: |
| {{{ | {{{#!sagecell |
| Line 171: | Line 171: |
| print option | |
| Line 183: | Line 182: |
| elif option == 'Stay': pass else: |
elif option != 'Stay': |
| Line 195: | Line 192: |
| time pylab.savefig('caca.png') | time pylab.savefig('mandelbrot.png') |
| Line 207: | Line 204: |
| {{{ | {{{#!sagecell |
| Line 210: | Line 207: |
| formula = list(['mandel','ff']),\ | formula = ['mandel','ff'],\ |
| Line 244: | Line 241: |
| {{{ | {{{#!sagecell |
| Line 272: | Line 269: |
== Sierpiński Triangle == by Eviatar Bach {{{#!sagecell %python from numpy import zeros def sierpinski(N): '''Generates the Sierpiński Triangle fractal to N iterations using the Rule 90 elementary cellular automaton. N is in powers of 2 because these produce "whole" triangles.''' M=zeros( (N,2*N+1), dtype=int) M[0,N]=1 rule=[0, 1, 0, 1, 1, 0, 1, 0] for j in range(1,N): for k in range(N-j,N+j+1): l = 4*M[j-1,k-1] + 2*M[j-1,k] + M[j-1,k+1] M[j,k]=rule[ l ] return M @interact def _(N=slider([2**a for a in range(0, 12)], label='Number of iterations',default=128), size = slider(1, 20, label= 'Size', step_size=1, default=9 )): M = sierpinski(N) plot_M = matrix_plot(M, cmap='binary') plot_M.show( figsize=[size,size]) }}} {{attachment:sierpinski.png}} |
Sage Interactions - Fractal
goto interact main page
Contents
-
Sage Interactions - Fractal
- Mandelbrot's Fractal Binomial Distribution
- Fractals Generated By Digit Sets and Dilation Matrices (Sage Days 9 - Avra Laarakker)
- Attempt at Generating all integer vectors with Digits D and Matrix A (How about vector([0,-1])?)
- Demonstrating that the Twin Dragon Matrix is likely to yield a Tiling of a Compact Interval of R^2 as k->infinity (It does!)
- Now in 3D
- Exploring Mandelbrot
- Mandelbrot & Julia Interact with variable exponent
- Sierpiński Triangle
Mandelbrot's Fractal Binomial Distribution
Fractals Generated By Digit Sets and Dilation Matrices (Sage Days 9 - Avra Laarakker)
Attempt at Generating all integer vectors with Digits D and Matrix A (How about vector([0,-1])?)
Demonstrating that the Twin Dragon Matrix is likely to yield a Tiling of a Compact Interval of R^2 as k->infinity (It does!)
Now in 3D
Exploring Mandelbrot
Pablo Angulo
Mandelbrot & Julia Interact with variable exponent
published notebook: http://sagenb.org/pub/1299/
Mandelbrot
by Harald Schilly
Julia
by Harald Schilly
julia_plot(-7,30,0.5,0.5,(-1.5,1.5), (-1.5,1.5))
Sierpiński Triangle
by Eviatar Bach
