What is the formula for the change of slope after a rotation of the coordinate system?

108 Views Asked by At

I have recently realized that the slope of a line depends on the coordinate system. Suppose we take the standard coordinate system and rotate it $45$ degrees (or, equivalently, $\pi / 4$ radians) counterclockwise. Then, lines of slope $1$ become lines of slope $0$. So, in general, if we rotate a coordinate system $x$ radians counterclockwise, where $x \in [0,2\pi)$, what is the new slope $m'$ of a line that formerly had slope $m$? I want a formula for that function. Also, just to clarify, I am considering lines with undefined slope as having slope $\infty$, the unsigned infinity.

1

There are 1 best solutions below

3
On BEST ANSWER

Well, the most natural way to find slope is to two a pair of points $(x_1,y_1),(x_2,y_2)$, and find the ratio in changes of their $y$- and $x$-coordinates. Rotations will preserve lines; that is, if $P,Q$ are on a line (containing the origin) and $R$ is a rotation, then $R(P),R(Q),$ and the origin all lie on the same line..

The rotation matrix $$ R_\theta := \begin{bmatrix} \cos \theta & - \sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} $$ rotates $\mathbb{R}^2$ counterclockwise $\theta$ radians about the origin. So let's find $R_\theta$ as it acts on points $(x_i,y_i)$. We will let $(x_i',y_i')$ denote the afterimage of the transformation. $$ \begin{bmatrix} x_i' \\ y_i' \end{bmatrix} = \begin{bmatrix} \cos \theta & - \sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x_i \\ y_i \end{bmatrix} = \begin{bmatrix} x_i \cos \theta-y_i \sin \theta \\ x_i \sin \theta + y_i \cos \theta \end{bmatrix} $$ Therefore, if $\ell,\ell'$ are the lines before and after (respectively) the transformation, $$\begin{align*} \text{slope of } \ell' &= \frac{y_2' - y_1'}{x_2' -x_1'} \\ &= \frac{x_2 \sin \theta + y_2 \cos \theta - (x_1 \sin \theta + y_1 \cos \theta)}{x_2 \cos \theta-y_2 \sin \theta - (x_1 \cos \theta-y_1 \sin \theta)}\\ &= \frac{(x_2-x_1) \sin \theta + (y_2-y_1) \cos \theta }{(x_2-x_1) \cos \theta+ (y_1 - y_2) \sin \theta }\\ &= \frac{\Delta x \sin \theta + \Delta y \cos \theta }{\Delta x \cos \theta - \Delta y \sin \theta } \end{align*} $$ up to your cosmetic preference for writing it, and with the convention that $\alpha/0$ represents an undefined slope (a vertical line, slope $\infty$, however you choose to interpret it).

I would wonder if one can explicitly get the slope of $\ell$ into this equation. If we notationally let $m$ represent that slope, up to it being well-defined, then dividing the top and bottom by $\Delta x$ would give $$ \text{slope of } \ell' = \frac{ \sin \theta +m \cos \theta }{ \cos \theta - m \sin \theta } $$ which is something, though it feels unsatisfying to me for some reason.


To help verify and visualize this, I made a Desmos demo. (Mostly as a sanity check to ensure my formula worked.)