Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- __author__ = 'Adam'
- class Point:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def apply_transformation(self, transformations):
- p_mat = np.matrix([[self.x], [self.y], [1]])
- res = np.dot(transformations, p_mat)
- self.x = res[0, 0]
- self.y = res[1, 0]
- return self
- def draw_to_svg(self, svg):
- svg.add_circle((self.x, self.y), 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement