Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def translate(x, y, offset):
- (dx, dy) = offset
- return x - dx, y - dy
- def draw(offset):
- data = np.zeros((100, 100))
- for i in range(-100, 100):
- for j in range(-100, 100):
- (x, y) = translate(i, j, offset)
- (x, y) = rotate(x, y)
- data[i, j] = ellipse(x, y)
- plt.imshow(data, cmap="gray")
- for i in range(len(translation_points)):
- plt.subplot(4, 7, i+1)
- draw(translation_points[i])
- for i in range(-100, 100):
- for j in range(-100, 100):
- def translate(x, y, offset):
- (dx, dy) = offset
- return x - dx - 50, y - dy - 50
- plt.xlim(-50, 50)
- plt.ylim(-50, 50)
- plt.imshow(data, cmap="cool", extent=[-data.shape[1]/2., data.shape[1]/2., -data.shape[0]/2., data.shape[0]/2.])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement