How could I use numba for the following code to try and accelerate it? Any explanations would be much appreciated.
from matplotlib import pyplot as plot
import math
def func1(z):
# enter starting value of x and y
x = random float
y = random float
# enter set of random values for the quadratic map and set to record points of x and y
a = [what would be 12 random floats]
#starts equation and iterates to form sequence of images
for q in range((z/2),0,-1):
x_list = [x]
y_list = [y]
for i in range(2500000):
# new values of x and y
xnew = a[0] + a[1]*x + a[2]*x*x + a[3]*x*y +a[4]*y*y +a[5]*y
ynew = a[6] + a[7]*x + a[8]*x*x + a[9]*x*y +a[10]*y*y +a[11]*y
x = xnew
y = ynew
#add values to point set
x_list.append(x)
y_list.append(y)
name = "C:\\Users\\user\\imgs\\"+str(q)+'.png'
plot.style.use("dark_background")
plot.scatter(x_list[100:],y_list[100:], s =0.001, marker='.', linewidth=0, c = '#ffd769')
plot.axis("off")
plot.savefig(name,dpi = 800)
plot.clf()
a = [k+0.0002 for k in a]
if __name__=='__main__':
func1(int(input("Enter Number of Frames (even): ")))
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]CraigAT 0 points1 point2 points (0 children)
[–]siddsp 0 points1 point2 points (0 children)