Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- relx = x-cx
- rely = y-cy
- rotx = relx*cos(-theta) - rely*sin(-theta)
- roty = relx*sin(-theta) + rely*cos(-theta)
- dx = max(abs(rotx) - width / 2, 0);
- dy = max(abs(roty) - height / 2, 0);
- return dx * dx + dy * dy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement