# Math Help - Rotating points around a known center

1. ## Rotating points around a known center

I don't know if this is the right forum, but here we go.

I have the situation where I have several known points in the plane that I want to rotate 45 degrees counterclockwise around a known center which is not (0,0). How do I do this, i.e. how do I find the new coordinates for each point?

I am using Matlab, if that matters.

2. Actually, I figured it out on my own. But now I have a different problem. I am plotting an ellipse in Matlab, and I want to rotate it 45 degrees, now clockwise, around it's center. Any ideas?

3. Say the point is (1,1).
And we want to find how it rotates ("a rotation matrix", but if that terms confuses you, ignore it).

Draw a new coordinate system having (1,1) in its center pararrel and perpindicular to the original system.

Then point (x,y) relative to the new coordinate system gets mapped to,
x'=sqrt{2}/2*x-sqrt{2}/2*y
y'=sqrt{2}/2*x+sqrt{2}/2*y

Thus, (x',y') is the new coordinate relative to the new coordinate system.
But relative to the old coordinate system it is,
(x'+1,y'+1)

4. Hello, changing_seasons!

I think I've worked this out correctly . . .

I have several known points in the plane that I want to rotate 45° CCW
around a known center which is not (0,0).
How do I find the new coordinates for each point?
Let P(x,y) be any point.
Let C(h,k) be the given center.

We will need two quantities:
. . . . . . . . . . . . - - - . . .______________
The distance CP: . r .= .√(x - h)² + (y - k)²
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y - k
The angle θ that CP makes with the positive x-axis: . tan θ .= .------
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x - h

Then: . x' .= .h + r·cos(θ + 45°)
. . . . . .y' .= .k + r·sin(θ + 45°)

. . I think . . .

5. Thanks for the help guys, but I found a way to solve both my problems.