help-octave
[Top][All Lists]
Advanced

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

Re: What does command fill exactly return?


From: Maynard Wright
Subject: Re: What does command fill exactly return?
Date: Thu, 24 Jun 2010 05:04:34 -0700
User-agent: KMail/1.10.1 (Linux/2.6.27-7-generic; KDE/4.1.4; i686; ; )

On Thursday 24 June 2010 04:41:54 Ben Abbott wrote:
> On Jun 23, 2010, at 5:54 AM, sd83 wrote:
> > Dear all,
> >
> > I'm working with curves and I have this problem: I have sampled closed
> > curves and I want to find the interior part of them. I have done some
> > experiments using fill command but I haven't find what I'm looking for. I
> > try to explain you the problems that I have find by examples.
> >
> > Let
> > t=[0:1/100:2*pi]
> > and
> > (cos(t),sin(t)) the unit circle.
> > If I run
> > fill(cos(t),sin(t));
> > it returns the plot of the circle with the interior part colored and it's
> > ok, but if I run
> > fill(cos(2*t),sin(2*t));
> > it returns only the plot of the cicle without the interior part colored.
> > Why? For my purpose (cos(t),sin(t)) and (cos(2*t),sin(2*t)) have the same
> > interior part.
> > I have noted that if I have a self intersect curve like two circles with
> > no empty intersection (but not only a point) command fill returns the
> > plot of the curve but the intersection of the circles is not colored.
> > Why? For my purpose the interior part of the two circles is the union of
> > the internal parts of them and not this union wthout the intersection.
> > How can I solve my problem? Is fill the best command I can run becouse of
> > my purpose?
> >
> > thank you
>
> I tried the following in Matlab
>
> >> fill(cos(t),sin(t),'r')
>
> The line above produced a circle filled with red and a black edge color.
>
> The line below produced an empty circle with a black edge color.
>
> >> fill(cos(2*t),sin(2*t),'r')
>
> I haven't looked at the detail, but I'd guess this respects the patch
> object. Replacing "fill(...)" with "patch(...)" gives the same result for
> me.
>
> Ben
>
>

Note that fill(cos(2*t), sin(2*t), 'r') writes two complete circles overlapping 
each other.  Try:

   t=[0:1/100:1.5*pi]
   fill(cos(2*t), sin(2*t), 'r')

and observe that half the circle is filled, presumably because the second 
circle is only half written over the first.  Because of the odd/even anomaly 
noted by others, I suggest that (maybe) fill applied to exactly coincident 
figures toggles the fill color on and off.  I haven't looked at the code.

Maynard Wright



reply via email to

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