Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function rotate_aabb(xmin, ymin, width, height, angle):
- Let c = cos(angle)
- Let s = sin(angle)
- Let halfw = 0.5*width
- Let halfh = 0.5*height
- Let xdelta = abs(c*halfw) + abs(s*halfh)
- Let ydelta = abs(s*halfw) + abs(c*halfh)
- Let xmin = xmin + halfw - xdelta
- Let ymin = ymin + halfw - ydelta
- Let width = 2*xdelta
- Let height = 2*ydelta
- Return (xmin, ymin, width, height)
- End Function
Add Comment
Please, Sign In to add comment