# Re: Definition and use of geometrical shapes

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
.

## Relevant Pages

• Re: Map square to circle
... hi would mapping a pixel square image into a circle. ... I would think the way to accomplish that would be to find a mapping from ... circle's pixel in the circle came from in the square. ...
(comp.soft-sys.matlab)
• Re: Stuck on another question
... mass of the circle inside. ... You can indeed use the color to draw dots, ... specifying the color of individual dots in a square, ... Should the pixel at coordinates be ...
(comp.lang.scheme)
• Re: Stuck on another question
... mass of the circle inside. ... You can indeed use the color to draw dots, ... specifying the color of individual dots in a square, ... Should the pixel at coordinates be ...
(comp.lang.scheme)
• Re: Stuck on another question
... mass of the circle inside. ... You can indeed use the color to draw dots, ... specifying the color of individual dots in a square, ... Should the pixel at coordinates be ...
(comp.lang.scheme)
• Re: circle boundaries
... Find the pixel that is the center of the circle. ... Compute distances between this pixel and the others ... Apply condition using the circle radius. ...
(comp.soft-sys.matlab)