# Mathematical problem

1. Dec 22, 2007

### transgalactic

i lack the knowledge in some area of polar coordenates

my problem is:

i was given a two points and an angle

one point is the center point the other is the the point we spin around the
center point by the given angle(rotation clock wise).

i have build a model to solve this problem by

slope=(y-center.y)/(x-center.x);
fi=arctan(slope);

beta=fi-angle;

x=center.x+xi;

y=center.y+yi;

but in a case of 2,1 as a center point
and 0,0 as the point we want to spin
when i spined it 90 deress(clock wise)

by this model i gave me a wronge answer (the right one is 1,3)

so by tryle and error method i found that we need to add 180 degrees

i dont know why
i dont know how to solve this problem
??
i want a solution for all the cases

2. Dec 22, 2007

### Shooting Star

You are talking about soving a problem, but you have not mentioned what is the problem. Mention it clearly. (The rest of your post is your method about an undefined problem.)

3. Dec 22, 2007

### transgalactic

i am looking for mathematical formulas that
takes two points
one point considered as a center point
the other point is the point which is rotated around her.
by a given angle
the direction of the rotation is clock wise

i want to find the coordinates of the point after we rotated the given one
around the cente point

for example
(0,1)
(0,0) -center point
rotation angle 90 degrees

there are many cases in this problems
i dont know how to solve it
how to find a method that solves all the possibilities

4. Dec 22, 2007

### Shooting Star

x = x'cosθ - y'sinθ
y = x'sinθ + y'cosθ

These are the formulae, if the x'-y' axes are rotated by angle θ anticlockwise. So, wrt x'-y' system, x-y sytem will rotate clockwise, thus giving you the answer.

5. Dec 22, 2007

### transgalactic

its not mentioned anywhere

i was tal to use polar angle etc...
i dont know ho to use them here??

6. Dec 22, 2007

### Shooting Star

The centre point is (0,0).

For polar angles, put x=r cos theta, y = r sin theta.

for example
(0,1)
(0,0) -center point
rotation angle 90 degrees

Try the formula I'd given to verify it. Use proper signs.

7. Dec 22, 2007

### transgalactic

for the center point 0,0 i had a working model that i shower
previosly
i tried your sulotion it dousnt work for all cases
like

in a case of 2,1 as a center point
and 0,0 as the point we want to spin
when i spined it 90 deress(clock wise)

i didnt get ( 1,3)

plz wright a whole formula for all cases
when i use
a1,b1 as a center point
a2,b2 as a spin point
beta as the angle we want to spin point a2,b2 clock wise

one formule for X

one formule for y

8. Dec 23, 2007

### HallsofIvy

Staff Emeritus
Where do people get this idea that there is some "magical formula" that will do everything for them? One of the reasons you learn "theory" or how to derive formulas is so you will be able to modify formulas for other situations.

Shootingstar gave you the formulas for the case when the "center point" is (0,0). If it not, if the center point is $(x_0, y_0)$, follow this procedure: translate all points so the center point is at (0,0). To do that, subtract $x_0$ from the x coordinate, $y_0$ from the y coordinate. Then use Shootingstar's formula to rotate. Finally, translate back to the starting position by adding $x_0$ and $y_0$.

In your example, in your first example, your center point is (2, 1) and you want to rotate (0, 0) 90 degrees about (2, 1). Okay. first "translate". Subtracting (2, 1) moves (2, 1) to (2- 2, 1-1)= (0,0) and moves (0, 0) to (0-2, 0-1)= (-2, -1). Now we want to rotate (-2,-1) 90 degrees around (0,0). cos(90)= 0, sin(90)= 1 so Shootingstar's formulas become x= x'cosθ - y'sinθ= (-2)(0)- (-1)(1)= 1 and y = x'sinθ + y'cosθ= (-2)(1)+ (-1)(0)= -2. Finally translate back: (1+ 2, -2+ 1)= (3, -2). I don't know why you said above "I didn't get (1, 3)" a rough picture should show you that rotating (0,0) 90 degrees counter clockwise around (2, 1) will give a point with x larger than 2 and y negative: (3, -2).

To rotate the point $(a_2, b_2)$ $\beta$ degrees counter clockwise around $(a_1, b_1)$:

First translate: $(a_2,b_2)$ is moved to $(a_2- a_1, b_2- b_1)$

Then rotate: $((a_2-a_1)cos(\beta)- (b_2-b_1)sin(\beta), (a_2-a_1)sin(\beta)-(b-2-b_1)cos(\beta))$.

Finally translate back: $((a_2-a_1)cos(\beta)- (b_2-b_1)sin(\beta)+ a_1, (a_2-a_1)sin(\beta)-(b-2-b_1)cos(\beta)+ b_2)$.

I can't imagine anyone trying to memorize or even use a formula in that form. Far better to think about what you are doing!