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