有点像是这个样子【我改了一下朝向】
omega = 2*pi;
t = linspace(0,4,1001);
x = 2 + cos(omega*t);
y = 2 + sin(omega*t);
dt = min(diff(t));
t0 = -t;
z = -t;
figure(1)
for i = 1:1:10000
t0 = t0 + dt;
x = 2 + cos(omega*t0);
y = 2 + sin(omega*t0);
p = [y(1),z(1),x(1)];
p1 = [y(1),z(1),0];
p2 = [0,z(1),x(1)];
plot3(y, z, x, 'g-');
hold on
plot3(y, z, zeros(size(x)), 'b-');
plot3(zeros(size(x)),z, x, 'r-');
plot3([p1(1),p(1)],[p1(2),p(2)],[p1(3),p(3)],'bo--','markersize',5,'markerfacecolor','b')
plot3([p2(1),p(1)],[p2(2),p(2)],[p2(3),p(3)], 'ro--','markersize',5,'markerfacecolor','r')
axis([min(x) max(x) min(y) max(y) -max(abs(z)) max(abs(z))])
view([50.4,20.4])
grid on
axis equal
pause(0.0001)
hold off
end
仅供参考