0
$\begingroup$

lets consider a point O$(x,y)$ inside a rectangle of having coordinates - a$(x_1,y_1)$, b$(x_2,y_2)$, c$(x_3,y_3)$, d$(x_4,y_4)$.

How to calculate the new coordinates of O$(x,y)$ if coordinates of rectangle change (i.e if rectangle moves or rotate with point) length of edges does not change.

enter image description here

$\endgroup$
1
  • $\begingroup$ Find the distance of translation by comparing their centres; find the rotation by comparing the slope of their diagonals. $\endgroup$ – Kenny Lau May 5 '16 at 9:05
1
$\begingroup$

This is a simpler method:


Find the distance of translation by comparing their centres:

The old centre is essentially $\displaystyle\left(\frac{x_1+x_2+x_3+x_4}4,\frac{y_1+y_2+y_3+y_4}4\right)$.

The new centre can be found by the same method.


Then, find the rotation by comparing the slope of any side:

The old slope of cd is $\displaystyle\frac{y_4-y_3}{x_4-x_3}$.

The new slope of cd can be found by the same method.

Then, calculate their angles of elevations respectively.

It is given by $\tan(\mbox{angle of elevation})=\mbox{slope}$.


After all that, you can translate O by the same distance and then rotate it by the same angle, relative to the new centre.

$\endgroup$
1
  • $\begingroup$ I want the formula to calculate new O(x) and new O(Y) from given new a(x1,y1), b(x2,y2), c(x3,y3), d(x4,y4) $\endgroup$ – linna May 5 '16 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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