rotate the graph of any function about any point

683 Views Asked by At

I am trying to take an arbitrary function and rotate it by an arbitrary amount of degrees about an arbitrary point. So far, I have the following function:

$$f(x,y)=\frac{g\left(x\cos(-O)-y\sin(-O)\right)-x\sin\left(-O\right)}{\cos(-O)}$$

that can rotate any function $g$ by any amount of degrees about the origin (that is $(0,0)$) (except for 90 degrees and -90 degrees due to divide by zero errors) where $O$ is the angle that I want to rotate the function by if the arguments $(x,g(x))$ are given. However, this equation will only rotate about the origin, and it does not meet my needs of rotating about any arbitrary point.

How would I edit the function to allow rotation about any point $(h,k)$?

2

There are 2 best solutions below

2
On BEST ANSWER

To rotate around an arbitrary point we can move the origin and then rotate. Say I want to rotate around $(a,b)$. To do this we subtract $(a,b)$ from every vector in the plane. This will take $(a,b)$ to $(0,0)$. For the graph of a function given by $(x,f(x))$ all the point would now be at $(x-a,f(x)-b)$. Rotate this vectors around the new origin as usual then move the origin back by adding $(a,b)$ to every vector and you're done.

0
On

Hint Conjugate your rotation map $R : \Bbb R^2 \to \Bbb R^2$ by the translation $$T : \Bbb R^2 \to \Bbb R^2, \qquad T(x, y) = (x - h, y - k) ,$$ that is, the desired rigid motion is $$T^{-1} \circ R \circ T .$$ You can think of this composition as temporarily replacing the coordinate system with one centered at (what in the original coordinate system is) the origin, rotating about the new origin, and then changing back to the old coordinate system.