We define the function f we want to rotate
In[]:=
g[x_]:=x^2
We define the rotating function for the x coordinate X[t] and for the y coordinate Y[t], in function of the parameter t, the function f we want to rotate and the angle of rotation a: (explanation of the function at the end)
In[]:=
X[t_,a_,f_]:=Cos*ArcCos-a*
f[t]
f[t]^2
t
t^2+f[t]^2
t^2+f[t]^2
In[]:=
Y[t_,a_,f_]:=Sin*ArcCos-a*
f[t]
f[t]^2
t
t^2+f[t]^2
t^2+f[t]^2
We can now plot the desired function at the desired angle a using a manipulate:
In[]:=
Manipulate[ParametricPlot[{X[t,a,f],Y[t,a,f]},{t,-20,20},PlotRange->{-10,10}],{a,-2Pi,2Pi},{f,{g,Sin,Exp,Sqrt}},SaveDefinitions->True]
Out[]=
By clicking on the buttons you can change the functions I implemented direcly. Or you can modify the functionf g[x] up top to show any function you would like.
Explanation:
Explanation:
It is clear that if you want to rotate the representation of a function in a plane, the resulting curve will not be a normal function as most of the time a single value of x will have two images. What we will get instead is the curve of a parametric function.Here are both functions for the x coordinate and for the y coordinate:
X[t_,a_,f_]:=Cos*ArcCos-a**ArcCos-a*
f[t]
f[t]^2
t
t^2+f[t]^2
t^2+f[t]^2
Y[t_,a_,f_]:=Sinf[t]
f[t]^2
t
t^2+f[t]^2
t^2+f[t]^2
The first step is to reduce t to a value between -1 and 1 so that we can work on the trigonometric circle. We want to work on a circle that has t for x and f[t] for y. This circle thus has a radius of :
t^2+f[t]^2
t
t^2+f[t]^2
We can visualise t as a point on the cosine axis in the trigonometric circle. We take it’s ArcCos to get an angle:
ArcCos
t
t^2+f[t]^2
Because ArcCos only gives the positive result by default, we multiply the result by the sign of the function at this point. We then substract the angle we want to rotate the function of:
f[t]
f[t]^2
t
t^2+f[t]^2
Now we just have to get the new coordinates of this point by applying Cos for the x coordinate and Sin for the y coordinate. We finnaly multiply by the scale we reduced t at the beginning to get the scaled value:
Cos*ArcCos-a*
f[t]
f[t]^2
t
t^2+f[t]^2
t^2+f[t]^2

