&nbsp; Hi Kishore,<br><br>&nbsp; I hope the following explanation will make the problem clear to you,<br><br>&nbsp; I have a map image (of India with states marked on it. Each state is a feature). When the user clicks on any position of the map, I draw a circle of 5km radius around the clicked point. Now&nbsp; I want to find out the the states that are completely covered by the circle, and the percentage of the other states that lie inside the circle.<br>
<br>&nbsp;I have drawn the circle using a bounding rectangle. Now the problem is, if there is a very small state that lies in any four corners of the rectangle, but not actually inside the circle, my algorithm considers it to be lying inside the circle as the state actually lies within the boundaries of the bounding rectangle.<br>
<br>&nbsp;I need to find out the states that actually lie inside the circle, the states that are completely excluded and the percentage of states that partially lie inside the circle(and not the bounding rectangle)<br><br>Can You help me with this?<br>
<br>Thanks,<br>Sucharita<br><br><br><div class="gmail_quote">On Fri, May 9, 2008 at 6:41 PM, P Kishor &lt;<a href="mailto:punk.kish@gmail.com">punk.kish@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Let&#39;s clarify a few things first --<br>
<div class="Ih2E3d"><br>
On 5/9/08, Sucharita Samuel &lt;<a href="mailto:iworktech.sucharita@gmail.com">iworktech.sucharita@gmail.com</a>&gt; wrote:<br>
&gt; Hi friends,<br>
&gt; I need to find the intersection of a rectangle and circle.<br>
<br>
</div>what exactly do you need to find?<br>
 &nbsp;- the points at which they intersect?<br>
 &nbsp;- whether or not they intersect?<br>
 &nbsp;- the overlapping area of their intersection?<br>
 &nbsp;- whether the circle is contained in the rect?<br>
 &nbsp;- whether the rect is contained in the circle?<br>
<div class="Ih2E3d"><br>
<br>
<br>
&gt; As you<br>
&gt; &nbsp;must be aware that a &nbsp;circle in mapserver terminology is a shapeobject<br>
&gt; drawn<br>
&gt; &nbsp;using the upper left and bottom right co-ordinates of a rectangle.<br>
<br>
</div>I am now aware of that at all. My MapServer is extremely rusty, but I<br>
remember drawing circles using MapScript and an equation that provided<br>
the center of the circle and the radius. As you can see, there are<br>
more than one ways to do it.<br>
<div class="Ih2E3d"><br>
<br>
&gt; &nbsp; &nbsp; &nbsp;In the above case I get the intersection of two rectangles, but as the<br>
&gt; &nbsp;circle lies inside the rectangle, i am not able to find whether my first<br>
&gt; &nbsp;rectangle intersects with the bottom corner of the rectangle(that contains<br>
&gt; &nbsp;the circle), which is not part of the circle.<br>
&gt;<br>
<br>
</div>once again, your question is not clear. If a circle &#39;C&#39; lies inside<br>
rectangle R, then the minimum bounding rectangle (MBR) of the circle<br>
&#39;C&#39; (which is always a square) will lie completely within &#39;R&#39;.<br>
Depending on your definition of intersection, there may or may not be<br>
any intersection at all.<br>
<div class="Ih2E3d"><br>
<br>
&gt; I am using <a href="http://ASP.NET" target="_blank">ASP.NET</a>. Any solution in this case would be of great help.<br>
&gt;<br>
<br>
<br>
</div><a href="http://ASP.NET" target="_blank">ASP.NET</a> is irrelevant here. Figure out clearly what you want to<br>
achieve, solve the problem as an algorithm problem, then you can<br>
implement it in any language you want to use.<br>
<br>
As is, at least to me, your question is not clear at all.<br>
<br>
<br>
&gt; Thanks in advance,<br>
&gt; Sucharita<br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div><br>