3

What is a formula (in terms of $x$ and $y$ coordinates) for rotating one point about another by $45$ degrees counterclockwise?

I've tried using: $$x'=x\cos(-45^{\circ})-y\cos(-45^{\circ})$$ $$y'=x\sin(-45^{\circ})+y\cos(-45^{\circ})$$

(I would, for instance, like to rotate rotate $(2, 1)$ by $-45^{\circ}$ degrees about $(2, 2)$)

Milo Brandt
  • 60,888
Nichols
  • 31
  • 3
    Welcome to Math.SE. You'll likely get better answers to your question if you explain exactly where you're getting stuck. What have you tried? – John Dec 08 '14 at 20:26
  • I was trying x'=x cos (-45) - y cos (-45) and y'=x sin (-45) + y cos (-45) – Nichols Dec 08 '14 at 20:30
  • @Nichols you are likely better off with $x' = x \cos \theta - y \sin \theta$ – gt6989b Dec 08 '14 at 20:37
  • Good. A couple of things. (1) What you wrote only works for rotations around the origin. (2) You rotated clockwise $45$ degrees with that rotation. – John Dec 08 '14 at 20:37

3 Answers3

2
  1. Translate so that you are rotating about the origin. In your case, subtract (2,2) from both what you are rotating and what you are rotating about.
  2. Perform the rotation about the origin.
  3. Add the original translation back.
gt6989b
  • 54,422
0

This can also be achieved nicely with complex numbers, using the fact that in multiplying complex numbers you multiply the lengths and add the angles. This means that to rotate a complex number $z$ by an angle $\theta$ about the origin you take $z\cdot(\cos\theta+i\sin\theta)$

To rotate $z$ by an angle $\theta$ about $w$, you would do $(z-w)\cdot(\cos\theta+i\sin\theta)+w$. (The subtracting and adding $w$ translates to and from the origin.)

In your example: $[(2+i)-(2+2i)]\cdot (-\frac{\sqrt{2}}{2}+i\frac{\sqrt{2}}{2})+(2+2i)$

paw88789
  • 40,402
0
  1. Translate the rotation center to the origin: $x'=x-x_c, y'=y-y_c$.

  2. Rotate around the origin: $x''=(x'-y')/\sqrt2, y''=(x'+y')/\sqrt2$.

  3. Translate back from the origin: $x'''=x''+x_c,y'''=y''+y_c$.