I'd like to plot a rotated parabolic cylinder. Like holding one point of the plane of symmetry with two fingers and let this plane rotate about this point.
There is the rotation matrix (for the y-axis).
And the parametrised surface is:
(u,v,u**2)
I've already plotted this surface for rotations about the x-axis:
Below is the modified(!) code to plot the rotations about the y-axis.
from math import cos,sin,pi
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.auto_scale_xyz([0, 500], [0, 500], [0, 0.15])
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
Us = np.arange(-1, 1, 0.005)
Vs = np.arange(-1, 1, 0.005)
for ch in [0.2*i*pi for i in range(3)]:
Xs = Us*cos(ch) + sin(ch)*(Us**2)
Ys = Vs
Xs, Ys = np.meshgrid(Xs, Ys)
Zs = -Us*sin(ch) + cos(ch)*(Us**2)
Axes3D.plot3D(ax,Xs,Ys,Zs, alpha=0.05)
And it doesn't work. It produces nonsense. This is the output i get:
The operations are identical, so i really can't see why it doesn't work. Can anyone tell me what i'm doing wrong?
I need to make this work in order to just look at the way algebraic surfaces transform when subjected to certain rotations. The code above is a crudely simplified snippet of what i am currently debugging. So the answer i am hoping for regards this particular code.