1. ## [SOLVED] Rotate about a pivot point

This is a programming problem, but the math is what I need help with.

The PHP ImagickDraw API's rotate() method does not take a pivot point in the parameters, it assumes the origin (0,0).

What I need to figure out is what to pass to translate(x,y) and rotate(degrees) to make a rectangle rotate about a specified pivot point.

So say I have pivotX and pivotY, how could I get the translateX, translateY, and rotation?

Additionally, I would like to know the new resulting bounding box that would be required to encompass the entire rectangle, but it's not absolutely necessary.

Thanks =)

2. Nevermind, I got it:

[PHP]
$rads = ($this->angle * pi() / 180.0);
$tx =$px - ($px * cos($rads)) + ($py * sin($rads));
$ty =$py - ($py * cos($rads)) - ($px * sin($rads));
[/PHP]