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