help-octave
[Top][All Lists]

## Re: Problems plotting the polygon of n-th complex roots

 From: Juan Pablo Carbajal Subject: Re: Problems plotting the polygon of n-th complex roots Date: Thu, 7 Nov 2013 16:58:57 +0100

```On Wed, Nov 6, 2013 at 11:18 PM, Tobal <address@hidden> wrote:
> 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
>
> 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.
> _______________________________________________
> Help-octave mailing list