Created
April 6, 2012 12:41
-
-
Save amitsaha/2319415 to your computer and use it in GitHub Desktop.
Circles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all;close all | |
% radius | |
for r=1:10 | |
lines=zeros(361,2); | |
cx=[];cy=[]; | |
for theta=0:360 | |
x=r*cos(theta); | |
y=r*sin(theta); | |
cx=[cx;x]; | |
cy=[cy;y]; | |
end | |
% plot the circle | |
plot(cx,cy,'r.'); hold on | |
% lines matrix | |
lines=[lines cx cy]; | |
% plot the lines | |
for i=1:size(lines,1) | |
plot([lines(i,1) lines(i,3)],[lines(i,2) lines(i,4)],'b-'); | |
hold on | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment