Re: Definition and use of geometrical shapes
- From: "Peter Bone" <peterbone@xxxxxxxxxxx>
- Date: Fri, 18 May 2007 10:49:45 -0400
Flavio Eripi wrote:
Unfortunately I´m familiar with mathematic and complex numbers, but
maybe I´m not able to explain what I need.
I need to obtain (and plot) the region where a user may be, and
this
is describes by the intersection of two (or more) circular rings.
Thus, I don´t want to know if a point is in the region, but I want
to
show this region, to know all the points which are included in it..
I hope it's better explained now.
Ah, ok. You could create an image array to display the region. Just
loop through each pixel in the image array using 2 nested for loops
and calculate if each pixel is within each of the circles by
calculating the distance from each of the circle centers and
comparing to the corresponding circle radius. If it's within the
region then set the pixel value to 1 (initialize with zeros). You can
speed this up by calculating the square of the distance and comparing
to the square of the radius (pre-calculate) to eliminate the slow
square root.
Peter
.
- Follow-Ups:
- Re: Definition and use of geometrical shapes
- From: Peter Bone
- Re: Definition and use of geometrical shapes
- References:
- Re: Definition and use of geometrical shapes
- From: John D'Errico
- Re: Definition and use of geometrical shapes
- From: Peter Bone
- Re: Definition and use of geometrical shapes
- From: John D'Errico
- Re: Definition and use of geometrical shapes
- From: Peter Bone
- Re: Definition and use of geometrical shapes
- From: Flavio Eripi
- Re: Definition and use of geometrical shapes
- Prev by Date: Re: How to find the coefficients? pls help!, urgent!
- Next by Date: Re: How to find the coefficients? pls help!, urgent!
- Previous by thread: Re: Definition and use of geometrical shapes
- Next by thread: Re: Definition and use of geometrical shapes
- Index(es):
Relevant Pages
|