Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from mpl_toolkits.mplot3d import Axes3D
  4.  
  5.  
  6. # calc
  7. L, M = np.meshgrid(np.linspace(0, 1, 1000), np.linspace(0, 1, 1000))
  8. L = 4 * L + 4
  9. area_top = L * (L - 4)
  10. area_left = L * M * 4
  11. area_right = L * L * (1 - M)
  12. depth = (area_top - area_left) ** 2 \
  13. + (area_top - area_right) ** 2 \
  14. + (area_left - area_right) ** 2
  15.  
  16. # plot
  17. fig = plt.figure()
  18. ax = fig.add_subplot(111, projection='3d')
  19. ax.invert_yaxis()
  20. ax.plot_wireframe(L, M * L, np.log(depth))
  21. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement