Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import numpy as np
  2.  
  3. __author__ = 'Adam'
  4.  
  5.  
  6. class Point:
  7. def __init__(self, x, y):
  8. self.x = x
  9. self.y = y
  10.  
  11. def apply_transformation(self, transformations):
  12. p_mat = np.matrix([[self.x], [self.y], [1]])
  13. res = np.dot(transformations, p_mat)
  14. self.x = res[0, 0]
  15. self.y = res[1, 0]
  16. return self
  17.  
  18. def draw_to_svg(self, svg):
  19. svg.add_circle((self.x, self.y), 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement