Mathematics Asked by Fygo on December 23, 2020

I have a rectangle which I need to rotate (blue rectangle in the image). The rotation origin is a random point somewhere inside of this rectangle (point Z in the image). The rotation is ALWAYS clockwise. Actually, the angle is set as well but that’s not really important.

After the rotation I need to find out the **distance between the points A and Z** on the *x axis* and **D and Z** – on the *y axis*. So basically I need to find the coordinates of point Z inside the "wrapping" (imaginary) rectangle that would exactly contain the blue rectangle and would not be rotated.

I was trying to translate the rotation center to 0, 0 but I am honestly confused with the swapped axis and the clockwise rotation. How should I go about it?

Since we are interested only in the distances related to the rotation center, nothing changes if we move the rotation center to the origin and consider all the coordinates with respect to that point. So consider a "straight" (meaning, parallel to the $y$-axis) line $AD$, so that $A=(x_0, a_0)$ and $D=(x_0, d_0)$. We rotate this line about the origin and call the new line $A'D'$ with coordinates $A'=(a_x, a_y)$ and $D'=(d_x,d_y)$.

Notice that both points $A$ and $D$ travel the angle $theta$ about the origin. Therefore, it is easy to compute the new coordinates of each point. The standard rotation matrix is $$ R_{text{counter-cw}} = left[ begin{array}{cc} cos theta & -sin{theta} \ sin theta & cos theta end{array} right] $$ but this is defined for counterclockwise rotations. Therefore, we have to just flip the sign of the angle (or take the transpose - these are the same in this case), giving $$ R_{text{cw}} = left[ begin{array}{cc} cos theta & sin{theta} \ -sin theta & cos theta end{array} right] $$ Now, the new coordinates are obtained by matrix multiplication: $$ left( begin{array}{c} a_x \ a_y end{array} right) = R_{text{cw}} left( begin{array}{c} x_0 \ a_0 end{array} right) = left( begin{array}{c} x_0 cos theta + a_0sin theta \ - x_0sin theta + a_0cos theta end{array} right) $$ $$ left( begin{array}{c} d_x \ d_y end{array} right) = R_{text{cw}} left( begin{array}{c} x_0 \ d_0 end{array} right) = left( begin{array}{c} x_0 cos theta + d_0sin theta \ - x_0sin theta + d_0cos theta end{array} right) $$ You wanted the distance in the $x$-direction, so it's easy to just take the absolute values of the $x$-coordinates of these results.

Correct answer by Matti P. on December 23, 2020

1 Asked on January 27, 2021 by smejak

convergence divergence logarithms proof explanation sequences and series

1 Asked on January 27, 2021 by bernard-mathews

1 Asked on January 27, 2021 by hk-lee

0 Asked on January 27, 2021 by shabir-ahmad

2 Asked on January 26, 2021 by user828643

abstract algebra group homomorphism group theory modular arithmetic

2 Asked on January 26, 2021 by t298

0 Asked on January 26, 2021

abstract algebra algebraic topology hopf algebras singularity terminology

1 Asked on January 26, 2021 by rom

1 Asked on January 26, 2021 by evan-kim

2 Asked on January 26, 2021 by user1936752

0 Asked on January 26, 2021

1 Asked on January 25, 2021 by siobhan-ren

1 Asked on January 25, 2021 by gibbs

1 Asked on January 25, 2021 by user854662

1 Asked on January 25, 2021 by losleon

Get help from others!

Recent Questions

- Iv’e designed a space elevator using a series of lasers. do you know anybody i could submit the designs too that could manufacture the concept and put it to use
- Need help finding a book. Female OP protagonist, magic
- Why is the WWF pending games (“Your turn”) area replaced w/ a column of “Bonus & Reward”gift boxes?
- Does Google Analytics track 404 page responses as valid page views?
- Why fry rice before boiling?

Recent Answers

- Jon Church on Why fry rice before boiling?
- Joshua Engel on Why fry rice before boiling?
- haakon.io on Why fry rice before boiling?
- Lex on Does Google Analytics track 404 page responses as valid page views?
- Peter Machado on Why fry rice before boiling?

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP