[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: |
Wed, 6 Nov 2013 14:18:58 -0800 (PST) |
I've rewroten the code with polar axes using epstk, the code
function [] = polares(z,n)
for k=0:n
theta(k+1)=((arg(z)+2*k*pi)/n);
rho(k+1)=abs(z);
end
eopen('polar.eps');
clf;
eglobpar;
ePlotTitleDistance = 25;
titulo = sprintf('Raices %d - esimas',n);
ePlotTitleText = titulo;
eaxespol([0 0.4 abs(z)],[0 round(180/n) 360]);
ePolarRadiusGridColor = [1 0 0];
ePolarAngleGridColor = [0 0 1];
if(imag(z)==0)
leyenda = sprintf('Poligono Regular %d lados de z =
%.2f',n,real(z));
elseif(real(z)==0)
leyenda = sprintf('Poligono Regular %d lados de z = %.2f
i',n,imag(z));
else
leyenda = sprintf('Poligono Regular %d lados de z = %.2f + %.2f
i',n,real(z),imag(z));
end
epolar(theta,rho,leyenda,0,[0 0 1],1.25);
epolar;
eclose;
eview;
clear;
end
This is the best option beacuse polar plot is the natural plot for these
type of regular polygons, where the vertices are complex numbers with a
radius and an angle.
Bye
--
View this message in context:
http://octave.1599824.n4.nabble.com/Problems-plotting-the-polygon-of-n-th-complex-roots-tp4658678p4658901.html
Sent from the Octave - General mailing list archive at Nabble.com.