How to a creat a sweeping radius, like that of a radar.
Ältere Kommentare anzeigen
For my university assignment I have to create a projectile simulator in the form of a radar, and I am struggling to create a radius that sweeps through the circle and was wondering if anyone could help, thanks very much.
Antworten (3)
Wayne King
am 20 Feb. 2014
It's easy enough to simulate that, but are you just interested in something for visual effect? In other words, not tied to any underlying computation.
theta=0:.01:2*pi;
y=exp(1i*theta);
for j=1:length(theta)
h=compass(real(y(j)),imag(y(j)));
set(h,'linewidth',2);
set(h,'color',[0 0 0])
title('(cos(\theta),sin(\theta))','fontsize',18);
pause(.01);
end
Alex
am 20 Feb. 2014
Iain
am 20 Feb. 2014
This is NOT the full answer, but it should get you started.
a = plot([0 xmax],[0 0],'r-');
hold on
b = plot(x,y,'bx');
c = plot(x1,y1,'cx');
for i = 0:360
set(a,'XData',[0, xmax],'YData',[0 ymax*sin(i*pi/180)])
% figure out how close the line is to passing a marker, and if its close enough
set(b,'Markersize',BIG)
% and if it's not...
set(c,'Markersize',small)
pause(0.1)
end
Kategorien
Mehr zu Detection, Range and Doppler Estimation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!