Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1.     ## Transforms the Point's x and y, given a Pose.
  2.     #  @pose The Pose object to transform against.
  3.     def transform(self, pose):
  4.         # Rotation
  5.         newX = self.x * math.cos(pose.r) - self.y * -math.sin(pose.r)
  6.         newY = self.x * -math.sin(pose.r) + self.y * math.cos(pose.r)
  7.  
  8.         return Point(newX + pose.x, newY - pose.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement