[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems plotting the polygon of n-th complex roots
From: |
Tobal |
Subject: |
Re: Problems plotting the polygon of n-th complex roots |
Date: |
Fri, 1 Nov 2013 16:46:36 -0700 (PDT) |
Ok, I've used patch and more commands and the code is this:
clf();
hold on; axis equal;
axis ([-1.5, 1.5,-1.5,1.5], 'square');
grid;
n=11;
for k=0:10
x(k+1)=cos(((2*k+1)*pi)/n);
y(k+1)=sin(((2*k+1)*pi)/n);
if(x(k+1)>0 && y(k+1)>0 || x(k+1)>0 && y(k+1)<0 )
drawLabels(x(k+1)+0.1,y(k+1),['w_' num2str(k)])
else
drawLabels(x(k+1)-0.25,y(k+1),['w_' num2str(k)])
end
end
p1 = [1 0];
p2 = [0 1];
p3 = [-1 0];
origin = [0 0];
circle = createCircle(p1, p2,p3);
drawCircle (circle,'r','LineWidth',2);
patch(x,y,'w','EdgeColor','b','Marker','o','MarkerFaceColor','flat','MarkerSize',8,'LineWidth',2)
for k=0:10
edge = [0 0 x(k+1) y(k+1)];
drawEdge(edge, 'linewidth', 1.15,'color','b');
end
title('Raices onceavas de la unidad');
An image
<http://octave.1599824.n4.nabble.com/file/n4658717/OctaveRaizUnidad.png>
Please, is there somebody know how to put correct labels w2, w3 , w10 ?
Thanks
--
View this message in context:
http://octave.1599824.n4.nabble.com/Problems-plotting-the-polygon-of-n-th-complex-roots-tp4658678p4658717.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Re: Problems plotting the polygon of n-th complex roots,
Tobal <=