help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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, 31 Oct 2013 16:24:03 +0100

On Thu, Oct 31, 2013 at 1:00 PM, Doug Stewart <address@hidden> wrote:
> It works for me!
>
> try a clear and then run your program again.
>
>
> On Thu, Oct 31, 2013 at 5:23 AM, Tobal <address@hidden> wrote:
>>
>> Hi! I'm trying to plot the polygon of x^11=-1 but the polygon isn't drawn
>> correctly. I suspect the problem is about precision. Here's the code:
>>
>> n=11;
>> for k=0:10
>>         x(k+1)=cos(((2*k+1)*pi)/n);
>>         y(k+1)=sin(((2*k+1)*pi)/n);
>> end
>>
>> t=0:pi/30:2*pi;
>> x1=cos(t);
>> y1=sin(t);
>>
>> clf();
>> plot(x,y,'b',x1,y1,'r')
>>
>> And here is an image:
>>
>> <http://octave.1599824.n4.nabble.com/file/n4658678/unidad.png>
>>
>>
>>
>> --
>> View this message in context:
>> http://octave.1599824.n4.nabble.com/Problems-plotting-the-polygon-of-n-th-complex-roots-tp4658678.html
>> Sent from the Octave - General mailing list archive at Nabble.com.
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://mailman.cae.wisc.edu/listinfo/help-octave
>
>
>
>
> --
> DAS
>
> https://linuxcounter.net/user/206392.html
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

It works here. Also, try the geometry package if you are working a lot
with polygons.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]