Three minute coding - tesselated 3D surface Python Matplotlib

preview_player
Показать описание
import numpy as np
from numpy import exp as e, linspace as l, meshgrid as m

R=20*(rand(10,2)-.5)

def surf_z(x,y):
return sum([e(-abs(x-a))+e(-abs(y-b)) for a, b in R])

x = l(0,10)
X,Y=m(x,x)

Z=surf_z(X,Y)

sS=10*rand(1000,2)

sZ=surf_z(sS[::,0],sS[::,1])

Рекомендации по теме
Комментарии
Автор

ImportError: No module named mpl_toolkits.mplot3d. i met this error now..

canyang
visit shbcf.ru