• January 17, 2022, 06:06:46 PM

### Author Topic: (Other) Smoke and mirrors  (Read 353 times)

0 Members and 1 Guest are viewing this topic.

#### youhn

• Fractal Furball
• Posts: 231
##### (Other)Smoke and mirrors
« on: January 20, 2021, 10:22:08 PM »
Short morph and rotation of a 4D julia of the well known $$z \rightarrow z^2 + c$$, applying some geometric algebra in Python.

Source used to learn the algebra: https://www.youtube.com/watch?v=nJnWM7R6Y5A

Python code:

Code: [Select]
import matplotlib.pyplot as pltimport math def linspace(start, stop, num):    return [start + (stop - start) / (num - 1) * k for k in range(num)] def zeros(rows, cols):    return [[0 for j in range(cols)] for i in range(rows)] d, n = 400, 280  # pixel density & number of iterationsr = 2 * 2 ** 2  # escape radius (must be greater than 2**2)x = linspace(-1.7, 1.7, 4 * d + 1)y = linspace(-1.3, 1.3, 3 * d + 1)T = zeros(len(y), len(x))var = linspace(0.0, 1*3.14159, 300) # parameter variation and no. of frames# time loopfor m, varc in enumerate(var):    # x in geometric algebra [scalar, e12, e23, e31]    a0 = 0.0    b0 = 0.0    c0 = 0.0244 + math.sin(varc*2)*0.01    d0 = 0.76 - math.cos(varc*2)*0.1       # image loop    for i, dp in enumerate(y):        for j, bp in enumerate(x):            a = bp * math.sin(varc)            b = bp * math.cos(varc)            c = 0.0            d = dp            # iteration loop to check for escape or bound            for k in range(n):                aa = a ** 2                bb = b ** 2                cc = c ** 2                dd = d ** 2                if aa + bb + cc + dd > r:                    break                # set temp variables to prevent calcuation errors                ax = a                bx = b                cx = c                dx = d                a = aa - bb - cc - dd + a0                b = (ax*bx - cx*dx)                b = b + b + b0                c = (ax*cx + bx*dx)                c = c + c + c0                d = (ax*dx - bx*cx)                d = d + d + d0            T[i][j] = k + 1         filename = "julia" + str(m).zfill(3) + ".png"    print(filename, c0, d0 )    plt.imshow(T, cmap=plt.cm.twilight_shifted)    plt.axis('off')    plt.savefig(filename, dpi=400, bbox_inches="tight", pad_inches=0)

#### Sabine62

• 3f
• Posts: 1250
##### Re: Smoke and mirrors
« Reply #1 on: January 21, 2021, 10:15:06 AM »
Very nice, I like the 'liquid glass' look!
To thine own self be true

### Similar Topics

###### Inside infinity mirrors

Started by Fraktalist on Share a fractal

9 Replies
2839 Views
November 25, 2017, 07:00:31 PM
by Deliberate Dendrite
###### Particle Storm - Cosmic Style Transfer Zoom Flight

Started by schizo on Fractal movie gallery

3 Replies
209 Views
April 04, 2021, 11:52:25 PM
by patched
###### Neural Style Transfer enhanced Mandelbrot zoom

Started by schizo on Fractal movie gallery

6 Replies
987 Views
December 22, 2020, 09:31:14 PM
by schizo
###### Neural Style Transfer with Fractal Art

Started by reallybigname on Other Artforms

1 Replies
909 Views
July 20, 2019, 04:25:41 PM
by reallybigname
###### Minuscule source code for Lyapunov images (ASCII style)

Started by marcm200 on Programming

8 Replies
1106 Views
March 20, 2019, 07:37:58 PM
by marcm200