Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=500, y=100, width=200, height=500, pivotX=100, pivotY=400
- x=450, y=150, width=100, height=400, pivotX=50, pivotY=50
- var radians = (Math.PI / 180) * red.degree;
- green.x += red.pivotX * Math.cos(radians) - red.pivotY * Math.sin(radians);
- green.y += red.pivotX * Math.sin(radians) + red.pivotY * Math.cos(radians);
- vx = green.x + green.pivotX - red.x - red.pivotX;
- vy = green.y + green.pivotY - red.y - red.pivotY;
- wx = Math.cos(radians)*vx - Math.sin(radians)*vy;
- wy = Math.sin(radians)*vx + Math.cos(radians)*vy;
- green.x += wx - vx;
- green.y += wy - vy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement