2

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)$?

  • This question has been edited since I wrote my answer, and the phrasing is more confusing to me now. The expression $f(x, y)$ is a function of two variables, so it's not clear to me exactly what your aim is. But N.B. that if a graph of a function $g$ is rotated by some angle (even one strictly less than $90^\circ$ in magnitude), sometimes the resulting curve is not the graph of a function. For example, rotating the graph of $\sqrt{1 - (1 - |x|)^2}$ by any angle $-90^\circ < O < 90^\circ$ produces a curve that is not the graph of a function. – Travis Willse Aug 20 '19 at 01:59

2 Answers2

5

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.

Travis Willse
  • 99,363
3

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.

CyclotomicField
  • 11,018
  • 1
  • 12
  • 29
  • how would I perform the second operation (moving the origin back) in terms of my function? – Ptolemy2002 Aug 20 '19 at 00:51
  • Just add $(a,b)$ to the vector after it's rotated. So subtract the vector to move the origin there, rotate with the subtraction about the origin on these new coordinates, then add $(a,b)$ to move the origin back after you're done rotating. – CyclotomicField Aug 20 '19 at 01:58