Re: Definition and use of geometrical shapes
- From: "Peter Bone" <peterbone@xxxxxxxxxxx>
- Date: Fri, 18 May 2007 08:54:21 -0400
John D'Errico wrote:
Peter Bone wrote:
define
John D'Errico wrote:
Flavio Eripi wrote:
OK, I have to verify if it's in each ring.. But how to
aFlavio
ring?
How to define a circle?
Thanks
I'm not sure what you mean. A circle is
defined by the center of the circle and
its radius. Reread the last few responses
I've made. The center is composed of two
numbers.
(xc,yc)
In two dimensions, you can even get tricky,
and define it as a complex number.
C = xc + i*yc
Now, compute the distance from C to any
other point (x,y), in the complex plane
the second point is just P = (x+i*y). So
the distance from C to P is
abs(C - P)
If that distance is less than the radius
of the circle, then P is inside the circle.
A ring is just two concentric circles with
the same center and different radii. REREAD
my responses to this thread.
John
I don't think that suggesting the use of complex numbers to
will help him!
I disagree. This will be the simplest
way to compute the distances that he
needs to compute. Its also the simplest
way to manage these numbers in two
dimensions.
But if you think its easier to do
otherwise, feel free to write out
the distances. Don't just tell me
how to answer the question without
bothering to provide an explicit
solution of your own.
John
BTW, you can skip the exclamation
marks.
I agree it's the simplest solution if you're familiar with the
mathematics. It's clear that the original poster doesn't have high
level of knowledge of mathematics since he doesn't know how a circle
is defined so I think it's unlikely that he's familiar with complex
numbers.
I did give my own method in a previous post. At the time I assumed he
had knowledge of Pythagoras theorem so I didn't bother writing down
the distance equation.
I don't think there's anything wrong with a single exclamation mark.
I was using it to express my surprise at the solution you chose
directed at someone who was obviously unlikely to understand it and
would get more confused by it.
Peter
.
- Follow-Ups:
- Re: Definition and use of geometrical shapes
- From: Flavio Eripi
- 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: Flavio Eripi
- 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
- Prev by Date: Need help: m to mex and c files (Image Processing application)
- Next by Date: Re: MATLAB Programming Contest: May 9 - May 16, 20
- Previous by thread: Re: Definition and use of geometrical shapes
- Next by thread: Re: Definition and use of geometrical shapes
- Index(es):
Relevant Pages
|