I am confused how my book comes up with the following formula-
Lets consider a Right angled Isoceles triangle with $2$ vertices on hypotenuse given as $(x_1,y_1)$ and $(x_2,y_2)$
Now the 3rd vertex $(a, b)$ is unknown and on the right angle...
My book says....
If we rotate the point $(x_1,y_1)$ around the point $(a,b)$ on an angle of $\theta$.
Then the point $(x_1,y_1)$ gets mapped to $(x_2, y_2)$ where:
$x_2 = (x_1-a) * \cos(\theta) - (y_1-b) * \sin(\theta) + a$
$y_2 = (x_1-a) * \sin(\theta) + (y_1-b) * \cos(\theta) + b$
.......(1)
How is this formula derived?
Now what i know is-
If in a general case $x, y$ are initial coordinates and $X, Y$ are final coordinates
$x= Xcos(\theta) - Ysin(\theta)........(2)$
$y = Ysin(\theta) + Ycos(\theta)........(3)$
And $x=X+h, y=Y+k..... (4)$
Please dont just replace the value of x and y and the vertices in (1) and tell me it is correct...I want a better explanation please.
I request you guys to please bridge the gap between the formula I know and the one I don't... :)
You know the formulas for a rotation with center in the origin $(0,0)$ and the formula for a translation, but what you have to do is a rotation with center in the point $(a,b)$.
You have to:
1) translate the origin on the point $(a,b)$, i.e. find the coordinates of the two vertices that you know in this new coordinate system. This gives:
$$ (x_1,y_1) \rightarrow (x_1-a, y_1-b) $$
$$ (x_2,y_2) \rightarrow (x_2-a, y_2-b) $$ 2) rotate by the angle $\theta$: $$ (x_1-a, y_1-b) \rightarrow ((x_1-a)\cos \theta-(y_1-b) \sin \theta,(x_1-a)\sin \theta+(y_1-b)\cos \theta) $$ and the same for the other point.
3) perform inverse tranlation so you have the coordinates in the old system, and this means that you add $a$ to the $x$ coordinates and $b$ to the $y$ coordinates. And you find the formula of your book.
If the triangle is right angled than $\theta =\pi/2$.