Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Since I forgot all the basics of math, I'm asking you to help me out with simple task.

enter image description here

I need to rotate text box in PDF. Rotation point is lower left corner, but I need to rotate it as if the rotation point would be on the center.

Since I am using a programming language, I can convert an angle in degrees to its radian equivalent (although I'm not sure if this will help)

Can you help me out to find lower left corner coordinates if rotation point is center?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

First of all, we need to convert the coordinates so the center is (0, 0). Doing this, the coordinates of the right lower corner are (131.5, 49.5). Rotation formula is

$$(x_1, y_1) = (x, y) * \left(\begin{matrix} \cos(\theta) & \sin(\theta) \\ -\sin(\theta) & \cos(\theta) \end{matrix}\right) = (x \cos(\theta)-y \sin(\theta), x \sin(\theta) + y \cos(\theta))$$

By putting $\theta=\frac{5\pi}{180}$, you get the new coordinates

$$ x_1 \approx 126.69, y_1 \approx 60.77$$

To know the distance we need to move the initial rectangle, need to subtract the initial and resulting coordinates

$$x_d = x_0-x_1 \approx 4.81$$ $$y_d = y_1-y_0 \approx 11.27$$

You need to add $x_d$ to the initial $x$ coordinates and $y_d$ to initial $y$ coordinates.

share|improve this answer
    
As usual, you rock! –  message Sep 10 '12 at 9:20
add comment

Subtract the difference between the center and the lower left corner from every point, do the thing you did earlier to rotate, add back the difference that you had subtracted.

share|improve this answer
    
That's not going to work that way, i can only provide values before it's rotated. So left corner value should be pre-calculated –  message Sep 7 '12 at 12:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.