jhylands

Rotate

Sep 1st, 2014
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def rotate(coordinates,angle):
  2.     #get the coordinates to local variables so its easyer to see whats going on
  3.     x = coordinates['x']
  4.     y = coordinates['y']
  5.     X = x * math.cos(angle) - y * math.sin(angle)
  6.     Y = x * math.sin(angle) + y * math.cos(angle)
  7.     return {'x':X,'y':Y}
Advertisement
Add Comment
Please, Sign In to add comment