Remove unused function and change line calc
Using @pijyoi's suggestion regarding line calculation broadcasting
This commit is contained in:
parent
f60fa3b534
commit
b01e0e0895
@ -29,17 +29,14 @@ gz = gl.GLGridItem()
|
||||
gz.translate(0, 0, -10)
|
||||
w.addItem(gz)
|
||||
|
||||
def fn(x, y):
|
||||
return np.cos(np.hypot(x, y))
|
||||
|
||||
n = 51
|
||||
y = np.linspace(-10,10,n)
|
||||
x = np.linspace(-10,10,100)
|
||||
for i in range(n):
|
||||
yi = np.array([y[i]]*100)
|
||||
yi = y[i]
|
||||
d = np.hypot(x, yi)
|
||||
z = 10 * np.cos(d) / (d+1)
|
||||
pts = np.vstack([x,yi,z]).transpose()
|
||||
pts = np.column_stack([x, np.full_like(x, yi), z])
|
||||
plt = gl.GLLinePlotItem(pos=pts, color=pg.glColor((i,n*1.3)), width=(i+1)/10., antialias=True)
|
||||
w.addItem(plt)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user