1

As a pastime, I'm trying to rotate the graph of $f(x)=\cos(x)$ about the point $O=(0,0)$, and I chose, arbitrarily, a rotation of $\pi /4$ radians.

My question is : how comes the parametric equation I came up with only works for the part of the graph that is to the right of $O=(0,0)$?

I reasoned as follow : rotating the graph is tentamount to rotating each point $P=(x, f(x))$ by $\pi/4$ rd. on a circle ( one for each point) centered at $(0,0)$ and of radius $OP = \sqrt {x^2+f(x)^2}$.

So I defined the following auxiliary functions :

(1) Let $OP= d(x)= \sqrt {x^2 + f(x)^2}$

(2) Let $T(x)=$ slope of $OP = \cos(x)/x$

(3) Let $A(x)$= angle of $OP$ with the $X-$axis $= \arctan (T(x))$.

Inasmuch as each point $P$ is supposed to turn on a circle of radius $d(x)$ and of center $O$, trigonometry can be used which gives ( with $P'$ denoting the image of $P$ under the expected $\pi/4$ counterclockwise rotation) :

  • $X$ coordinate of $P'$ : $d(x)\cos(A(x)+\pi/4)$

  • $Y$ coordinate of $P'$ : $d(x)\sin(A(x)+\pi/4)$.

Hence the parametric equation :

$\bigg<d(t)\cos(A(t)+\pi/4), d(t)\sin(A(t)+\pi/4)\bigg>$

However, this parametric equation produces the desired result only for positive values of $t$ ( or of $x$).

Probably some feature of the $\tan(x)$ function could explain this, but I cannot identify which one it is.

here : a link to my attenpt using Desmos https://www.desmos.com/calculator/mjj6mnr55t

Below, an image for $x\gt 0$

enter image description here

Here , an image of what happens when $x\lt 0$ , point P is in green , its "image " under the parametric function is in dark grey.

enter image description here

  • 2
    i think it will work when you use a signed distance ie replace d(t) with d(t)sgn (t) – Calvin Khor Nov 24 '21 at 15:09
  • @CalvinKhor.- I'm going to try this, thanks for this hint! – Vince Vickler Nov 24 '21 at 15:12
  • @CalvinKhor Adding a " sign function" actually works ! I first hadn't used the correct range for parameter $t$. – Vince Vickler Nov 24 '21 at 15:22
  • https://www.desmos.com/calculator/yan7l8d56h – Vince Vickler Nov 24 '21 at 15:23
  • 1
    Alternatively, plot the points $\left(\dfrac{x-f(x)}{\sqrt2},\dfrac{x+f(x)}{\sqrt2}\right)$. No need for polar coordinates. –  Nov 24 '21 at 15:24
  • 1
    And @SteveDaou's suggestion is just a special case of plotting $\begin{pmatrix} \cos(\theta) & -\sin(\theta) \ \sin(\theta) & \cos(\theta) \end{pmatrix} \begin{pmatrix} x \ f(x) \end{pmatrix}$. – Jakob Streipel Nov 24 '21 at 15:26
  • @SteveDaou . I tried your suggestion , which actually produces the desired result. If ever you had some time to spend on this soft question, explaining this formula in an official answer would be great! – Vince Vickler Nov 24 '21 at 15:41
  • 1
    @prets gave a more general answer. –  Nov 24 '21 at 15:44

1 Answers1

1

By OP's request, a short explanation of the matrix formula: The matrix $$ \begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{pmatrix} $$ is the $2 \times 2$ rotation matrix by $\theta$ radians, as can be observed by noting that the first column is the anticlockwise rotation of the unit vector $(1, 0)$ by $\theta$ radians, and the second column is the same transformation of $(0, 1)$. (Draw some triangles with hypotenuse $1$ to convince yourself of this if you haven't played this game before!)

Hence if you take any point/vector $(x, y)$ in the plane and multiply it by this matrix, you get precisely the same point back, only rotated $\theta$ radians anticlockwise.

For our purposes, the points we are interested in are the points $(x, f(x))$ on the graph, so $$ \begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{pmatrix} \begin{pmatrix} x \\ f(x) \end{pmatrix} = \begin{pmatrix} x \cos(\theta) - f(x) \sin(\theta) \\ x \sin(\theta) + f(x) \cos(\theta) \end{pmatrix} $$ is exactly the rotation (by $\theta$ radians anticlockwise) of the graph in question.

Specialising at $\theta = \pi/4$ then gives the parametrisation $$ \Bigl( \frac{x - f(x)}{\sqrt{2}}, \frac{x + f(x)}{\sqrt{2}} \Bigr) $$ since $\cos(\pi/4) = \sin(\pi/4) = 1/\sqrt{2}$.