MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to get the area of circles


Wow.....
I don't know... But of course, there is always the
numerical-and-extremely-inefficient-way.

circles={{{a1,b1},rad1},{{a2,b2},rad2},....{{an,bn},radn}};
(*The list of circles*)
{lsupx,linfx,lsupy,linfy}=
{circles[[All,1,1]]+circles[[All,2]]//Max,
circles[[All,1,1]]-circles[[All,2]]//Min,
circles[[All,1,2]]+circles[[All,2]]//Max,
circles[[All,1,2]]-circles[[All,2]]//Min}
(*A rectangle that contains them*)
<<Calculus`Integration` (*a package*)
inside[{x_,y_}]=Boole[Or@@(Simplify[Norm[{x,y}-#[[1]] 
]<#[[2]]&/@circles,Assumptions->{Element[x,Reals],Element[y,Reals]}])]
(*a function that is 1 inside and zero otherwise*)
NIntegrate[inside[{x,y}],{x,linfx,lsupx},{y,linfy,lsupx}]
(*and the numerical integration*)

It's slow.


Atte. Andres Guzman



doufunao <gaoshan2002 at gmail.com> ha escrito:

>
> hi guys,
>
> I'm working on a project. I need to calculate the area of many circles
> in a 2D space which may overlap each other.
> It's quite complicated. I am not sure whether mathematica can do this.
> Is there any software/lib/package available already?
> thanks.
>
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



  • Prev by Date: Re: how to get the area of circles
  • Next by Date: Re: Integral of Piecewise function involving DiracDelta
  • Previous by thread: how to get the area of circles
  • Next by thread: Re: how to get the area of circles