Skip to main content
Inspiring
February 11, 2007
Question

calculating the minimal diameter of a circle engulfing a number of randomply positioned dots

  • February 11, 2007
  • 12 replies
  • 1031 views
There are a number of dots randomly scattered across the screen. The
coordinates of each dot are known.
What would be the algorithm to calculate the minimal diameter of a circle
engulfing all the dots and the coordinates of its center?


This topic has been closed for replies.

12 replies

kglad
Community Expert
Community Expert
February 12, 2007
lol, flat.
kglad
Community Expert
Community Expert
February 12, 2007
you're welcome.
Inspiring
February 12, 2007
The most valid point, kglad. I did a tiny dot clip and did not much care
about it's center for it was tiny. But when I used the same clip to blow it
up to big circle, it caused the error. Thanks a lot for being patient.

"kglad" <webforumsuser@macromedia.com> wrote in message
news:eqqiuf$igm$1@forums.macromedia.com...
> aa, does your dot have registration point at its center?


Inspiring
February 12, 2007
If your code is correct (and I sincerely want it to be) please will you add
just 4 lines of code attaching another dot of right diameter and positioning
it into right place demonstrating your idea?
This is much better proof then a thousand of words.

"kglad" <webforumsuser@macromedia.com> wrote in message
news:eqqic3$hsg$1@forums.macromedia.com...
> you didn't understand it correctly, flatcoat: consider the two points
that are
> separated by maximum distance d. draw your circle.
>
> now draw a circle with RADIUS d centered around each of those points.
now
> pick any point that's within the interior of both large circles and
outside the
> your circle. that point is a counter example to your proposition that all
> points would lie within your circle.
>
> proving that such points exist requires more than hand waving. but
that's
> pretty straight forward and easy to see with a diagram.
>


kglad
Community Expert
Community Expert
February 12, 2007
aa, does your dot have registration point at its center?

p.s. 1.5 is larger than sqrt(2) which is a factor that guarantees a circumscribing circle.
kglad
Community Expert
Community Expert
February 12, 2007
you didn't understand it correctly, flatcoat: consider the two points that are separated by maximum distance d. draw your circle.

now draw a circle with RADIUS d centered around each of those points. now pick any point that's within the interior of both large circles and outside the your circle. that point is a counter example to your proposition that all points would lie within your circle.

proving that such points exist requires more than hand waving. but that's pretty straight forward and easy to see with a diagram.
Inspiring
February 12, 2007
quote:

Originally posted by: kglad

proving that such points exist requires more than hand waving. but that's pretty straight forward and easy to see with a diagram.


Okay - I'm not waving then, but drowning.
My code needs a constant multiplier to guarantee an encompassing circle.
Sorry to interrupt people... I'll get my coat.
Inspiring
February 12, 2007

"kglad" <webforumsuser@macromedia.com> wrote in message
news:eqq2fb$s66$1@forums.macromedia.com...
> finding the circle with smallest diameter that intersects 3 points was
solved in antiquity.
Yes, but the snag is that I need smallest diameter ENCLOSING 3 dots which
often is smaller then smallest diameter that intersects these 3 dots.


Inspiring
February 12, 2007
sorry.. double post edited to nothing
kglad
Community Expert
Community Expert
February 12, 2007
finding the circle with smallest diameter that intersects 3 points was solved in antiquity.
Inspiring
February 12, 2007

"kglad" <webforumsuser@macromedia.com> wrote in message
news:eqo31f$iom$1@forums.macromedia.com...
the solution for 3 dots was known to the ancient greeks and is trivial
mathematically.

If you mean drwing a circle across the three dots, it is indeed well
documented by Pifagor, but it does not solve the problem. If you meant
something else, what is it?


kglad
Community Expert
Community Expert
February 11, 2007
the solution for 3 dots was known to the ancient greeks and is trivial mathematically. for more dots i would use a min-max algorithm. because the dots are not related to some underlying function but are randomly placed i don't know of any other way to solve this than brute force.

that said the number of calculations required would be on the order of w*h*numDots where w is the width of the allowed region, h is the height and numDots is the number of randomly placed dots.

even flash can handle that number of calculations as long as numDots is not greater than say 10,000.
kglad
Community Expert
Community Expert
February 11, 2007
here's a brute force method: