Advertisement
Guest User

itower

a guest
Jan 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import math
  2.  
  3. import matplotlib.pyplot as plt
  4. import numpy as np
  5. from matplotlib import cm
  6. from mpl_toolkits.mplot3d import Axes3D
  7.  
  8. i = complex(0, 1)
  9. height = [x for x in range(0,100)]
  10. real = []
  11. imag = []
  12.  
  13. def tower(x, n):
  14.     result = 0
  15.     for _ in range(0, n + 1):
  16.         result = x**result
  17.     return result
  18.  
  19.  
  20. for a in range(1, 101):
  21.     r = tower(i, a)
  22.     real.append(r.real)
  23.     imag.append(r.imag)
  24.  
  25. fig = plt.figure()
  26. ax = fig.add_subplot(111, projection='3d')
  27. x, y, z = real, imag, height
  28. ax.plot3D(x, y, z)
  29. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement