Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Transforms the Point's x and y, given a Pose.
- # @pose The Pose object to transform against.
- def transform(self, pose):
- # Rotation
- newX = self.x * math.cos(pose.r) - self.y * -math.sin(pose.r)
- newY = self.x * -math.sin(pose.r) + self.y * math.cos(pose.r)
- return Point(newX + pose.x, newY - pose.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement