Here is my approach:
# input circles, remove duplicates, store them
# check whether all circle intersect:
if no: print '0.0'
if yes:
# calculate intersection points of two circles.
# check if that point lies in rest all circles
if yes: store it as polygon-coordinates (hull)
calculat
Chris Rebert wrote:
On Thu, Feb 4, 2010 at 2:39 AM, Shashwat Anand wrote:
Given 'n' circles and the co-ordinates of their center, and the radius of
all being equal i.e. 'one', How can I take out the intersection of their
area.
How is this at all specific to Python?
This also sounds suspiciou
maximum number of circles = 10**6
runtime <= 5 sec
center of circles , -1000<=xi,yi<=1000 (float) [for int it was easier]
intersection is there and the area will be non-zero (it can always be
checked if intersection is taking place and if no, then area = 0.00)
This was a programming contest pro
On 2/4/2010 7:05 AM, Shashwat Anand wrote:
> I want to calculate areas.
> like for two circles (0, 0) and (0, 1) : the output is '1.228370'
>
> similarly my aim is to take 'n' co-ordinates, all of radius '1' and
> calculate the area common to all.
> The best I got was monte-carlo methods which is i
Shashwat Anand wrote:
I want to calculate areas.
like for two circles (0, 0) and (0, 1) : the output is '1.228370'
similarly my aim is to take 'n' co-ordinates, all of radius '1' and
calculate the area common to all.
The best I got was monte-carlo methods which is inefficient. Is there any
other
Gary Herron wrote:
Gerard Flanagan wrote:
A brute force approach - create a grid of small squares and calculate
which squares are in all circles. I don't know whether it is any
better than monte-carlo:
That's just what the monte-carlo method is -- except the full family of
monte-carlo met
Gerard Flanagan wrote:
On 2/4/2010 7:05 AM, Shashwat Anand wrote:
I want to calculate areas.
like for two circles (0, 0) and (0, 1) : the output is
'1.228370'
similarly my aim is to take 'n' co-ordinates, all of radius
'1' and
calculate the area common
On 2/4/2010 7:05 AM, Shashwat Anand wrote:
I want to calculate areas.
like for two circles (0, 0) and (0, 1) : the output is '1.228370'
similarly my aim is to take 'n' co-ordinates, all of radius '1' and
calculate the area common to all.
The best I g
thanks, all of you
On Thu, Feb 4, 2010 at 7:31 PM, Terry Reedy wrote:
> On 2/4/2010 7:05 AM, Shashwat Anand wrote:
>
>> I want to calculate areas.
>> like for two circles (0, 0) and (0, 1) : the output is '1.228370'
>>
>> similarly my aim is to take 'n' co-ordinates, all of radius '1' and
>> cal
On 2/4/2010 7:05 AM, Shashwat Anand wrote:
I want to calculate areas.
like for two circles (0, 0) and (0, 1) : the output is '1.228370'
similarly my aim is to take 'n' co-ordinates, all of radius '1' and
calculate the area common to all.
The best I got was monte-carlo methods which is inefficien
It's an interesting problem. Never thought it was this difficult. I can't
account for all geometrical enumerations, but assuming all 4 circles
intersect, here's the solution for this particular senario. It's probably
not going to be useful to you since you're working on geometrical
approximations n
I needed 6 decimal places of accuracy, so first way of solution will not
work for my case. However, your second strategy seems promising. Working on
it. Thanks :D
~l0nwlf
On Thu, Feb 4, 2010 at 5:49 PM, Bearophile wrote:
> Shashwat Anand:
> > > Given 'n' circles and the co-ordinates of their cen
Shashwat Anand:
> > Given 'n' circles and the co-ordinates of their center, and the radius of
> > all being equal i.e. 'one', How can I take out the intersection of their
> > area.
I can see two possible solutions, both approximate. In both solutions
you first look if there are a pair of circles t
I want to calculate areas.
like for two circles (0, 0) and (0, 1) : the output is '1.228370'
similarly my aim is to take 'n' co-ordinates, all of radius '1' and
calculate the area common to all.
The best I got was monte-carlo methods which is inefficient. Is there any
other approach possible.
On
I'm not sure what you're after. Are you after how to calculate the area? Or
are you trying to graph it? Or an analytical solution?
What do you mean by "take out the intersection"?
-Xav
On Thu, Feb 4, 2010 at 9:47 PM, Shashwat Anand wrote:
> I wanted some general suggestion/tips only
>
>
> On Th
I wanted some general suggestion/tips only
On Thu, Feb 4, 2010 at 5:11 PM, Chris Rebert wrote:
> On Thu, Feb 4, 2010 at 2:39 AM, Shashwat Anand
> wrote:
> > Given 'n' circles and the co-ordinates of their center, and the radius of
> > all being equal i.e. 'one', How can I take out the intersect
On Thu, Feb 4, 2010 at 2:39 AM, Shashwat Anand wrote:
> Given 'n' circles and the co-ordinates of their center, and the radius of
> all being equal i.e. 'one', How can I take out the intersection of their
> area.
How is this at all specific to Python?
This also sounds suspiciously like homework,
17 matches
Mail list logo