Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- from mpl_toolkits.mplot3d import Axes3D
- # calc
- L, M = np.meshgrid(np.linspace(0, 1, 1000), np.linspace(0, 1, 1000))
- L = 4 * L + 4
- area_top = L * (L - 4)
- area_left = L * M * 4
- area_right = L * L * (1 - M)
- depth = (area_top - area_left) ** 2 \
- + (area_top - area_right) ** 2 \
- + (area_left - area_right) ** 2
- # plot
- fig = plt.figure()
- ax = fig.add_subplot(111, projection='3d')
- ax.invert_yaxis()
- ax.plot_wireframe(L, M * L, np.log(depth))
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement