Home > Archive > Matlab > April 2005 > Circle within square
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Circle within square
|
|
| Guillaume 2005-04-21, 9:00 pm |
| Hi, I am trying to calculate the average proportion of a circle of fixed
radius that falls within a square of a fixed dimension, if the center of
the circle can be located anywhere within the square. I know this can be
seen as an integration problem and I can already calculate this
numerically using dblquad and some trigonometry, but was hoping for an
analytical solution.
Any idea how this can be done analytically?
Thanks for all the input you can give me!
Guillaume
| |
| Roger Stafford 2005-04-22, 4:00 am |
| In article <oDV9e.1336$uE3.216@charlie.risq.qc.ca>, Guillaume
<larocque@mail.com> wrote:
> Hi, I am trying to calculate the average proportion of a circle of fixed
> radius that falls within a square of a fixed dimension, if the center of
> the circle can be located anywhere within the square. I know this can be
> seen as an integration problem and I can already calculate this
> numerically using dblquad and some trigonometry, but was hoping for an
> analytical solution.
>
> Any idea how this can be done analytically?
>
> Thanks for all the input you can give me!
>
> Guillaume
--------
Hello Guillaume,
When you say "average proportion of a circle", are you referring to the
fraction of the circle's arc within the square, or the fraction of its
area within the square? The two concepts are very different. Whichever
you mean, I take it you wish to find the area mean value (equal areas of
the center location have equal weights in the averaging) of this fraction
over all possible center locations within the square. Do I interpret that
correctly? Do you have anything to say about the relative sizes of the
circle's radius and the square's side?
(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
| |
| Guillaume 2005-04-22, 4:04 pm |
| Hi, I am looking for a proportion of a circles' arc within a square. For
example, a circle with a center located exactly at the corner of the
square will have a proportion of 0.25 of its arc (and area) within the
square, while a circle located in the center will have a proportion of
1. That reasoning only works if the diameter of the circle is less than
the squares' side. It would be nice to obtain a very general solution
but I could live with a solution that assumes the diameter of the circle
is less than the square's side.
Keep in mind that I am looking for an "expected proportion" over all
possible circles with a center located within the square, and not just
the proportion of a given circle.
Thanks,
Guillaume
> In article <oDV9e.1336$uE3.216@charlie.risq.qc.ca>, Guillaume
> <larocque@mail.com> wrote:
>
>
>
> --------
> Hello Guillaume,
>
> When you say "average proportion of a circle", are you referring to the
> fraction of the circle's arc within the square, or the fraction of its
> area within the square? The two concepts are very different. Whichever
> you mean, I take it you wish to find the area mean value (equal areas of
> the center location have equal weights in the averaging) of this fraction
> over all possible center locations within the square. Do I interpret that
> correctly? Do you have anything to say about the relative sizes of the
> circle's radius and the square's side?
>
> (Remove "xyzzy" and ".invalid" to send me email.)
> Roger Stafford
| |
| John D'Errico 2005-04-22, 4:04 pm |
| In article <pg6ae.1344$uE3.615@charlie.risq.qc.ca>,
Guillaume <larocque@mail.com> wrote:
> Hi, I am looking for a proportion of a circles' arc within a square. For
> example, a circle with a center located exactly at the corner of the
> square will have a proportion of 0.25 of its arc (and area) within the
> square, while a circle located in the center will have a proportion of
> 1. That reasoning only works if the diameter of the circle is less than
> the squares' side. It would be nice to obtain a very general solution
> but I could live with a solution that assumes the diameter of the circle
> is less than the square's side.
>
> Keep in mind that I am looking for an "expected proportion" over all
> possible circles with a center located within the square, and not just
> the proportion of a given circle.
I find it virtually impossible to believe there is any
simple result available when the diameter is larger
than the side of the square, since there may be multiple
intersections with the sides of the square. Even for
small diameters, this seems to be a less than trivial
computation.
Can you compute the result via numerical integration for
multiple diameters given a unit square, then interpolate
using a spline? I.e., do you really need an analytical
form?
Symmetry allows the expectation integral (for a given
diameter circle) to be done over only 1/8 of the unit
square, so this should not be that time consuming if
only done once.
HTH,
John D'Errico
--
The best material model of a cat is another, or
preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
| |
| Roger Stafford 2005-04-22, 9:00 pm |
| In article <pg6ae.1344$uE3.615@charlie.risq.qc.ca>, Guillaume
<larocque@mail.com> wrote:
> Hi, I am looking for a proportion of a circles' arc within a square. For
> example, a circle with a center located exactly at the corner of the
> square will have a proportion of 0.25 of its arc (and area) within the
> square, while a circle located in the center will have a proportion of
> 1. That reasoning only works if the diameter of the circle is less than
> the squares' side. It would be nice to obtain a very general solution
> but I could live with a solution that assumes the diameter of the circle
> is less than the square's side.
>
> Keep in mind that I am looking for an "expected proportion" over all
> possible circles with a center located within the square, and not just
> the proportion of a given circle.
>
> Thanks,
>
> Guillaume
-----------------
Hello again Guillaume,
I've convinced myself that, at least in the case where the square's side
is not less than twice the circle's radius, your mean value arc length
problem has an explicit solution. That is, the arclength function of
circle center position can be doubly integrated in terms of known
functions. In fact, it's probably a good project for an enterprising
student of calculus. It's a matter of twice integrating certain arcsin
functions. The difficulty is that the form of the arclength function
changes for different regions of the square so that the double integral
limits have to adjust according to location in the square.
However, in order to communicate my reasoning with you, I think we
should do it via email so I can send diagrams. Does the address
"Guillaume" <larocque@mail.com> work all right, and do you want me to go
ahead with it?
(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
|
|
|
|
|