仅供参考
clear all;
clc;
close all;
w=8*pi;%角速度
v=10;%下落速度为10m/s
%下落高度 130-20
%探测角是30度
%斜距是150 75
%1!!!画动态螺旋曲线%%
%
z = peaks(0);
surf(z)
hold on
t=linspace(13,0,1000);
x=v*t.*cos(w*t);
y=v*t.*sin(w*t);
z=v*t;
h1=animatedline;
h2=animatedline('color', 'g');
h1.Color = 'r';
h1.LineWidth = 1.0;
h1.LineStyle = '-';
axis([-150,150,-150,150]);
title('扫描轨迹');
for i = 2:length(t)
% addpoints(h1,x(i),y(i),z(i));
a=[x(i),y(i),0];
h(i)=quiver3(0,0,z(i),x(i),y(i),-z(i),0,'ShowArrowHead','off','Color','r');
delete(h(i-1))
addpoints(h2,x(i),y(i),0);
pause(0.02);
drawnow
end
