<div dir="ltr">On Sun, Sep 1, 2013 at 3:55 PM, Josè Luis Mietta <span dir="ltr"><<a href="mailto:joseluismietta@yahoo.com.ar" target="_blank">joseluismietta@yahoo.com.ar</a>></span> wrote:<br><div class="gmail_extra">

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:'times new roman','new york',times,serif">

<div><span style="font-size:small">Given two arbitrary sticks, i need a simple and effective algorithm that determinate if that two sticks are conected by a 'intersected-sticks' path.</span><br></div><div><font><br>

</font></div></div></div></blockquote><div><br></div><div style>do you mean a test to see if two line segments intersect?</div><div style><br></div><div style>This looks reasonable:</div><div style><br></div><div style><a href="http://wiki.processing.org/w/Line-Line_intersection">http://wiki.processing.org/w/Line-Line_intersection</a><br>

</div><div style><br></div><div style>It probably makes sense to translate to Cython (or use the C and call with cython).</div><div style><br></div><div style>I"ve also got similar code in a little package of mine:</div>

<div style><br></div><div style><a href="https://github.com/ChrisBarker-NOAA/py_geometry">https://github.com/ChrisBarker-NOAA/py_geometry</a><br></div><div style><br></div><div style>Already Cython, and includes code to check a whole bunch at once, stored in numpy arrays:</div>

<div style><br></div><div style><a href="https://github.com/ChrisBarker-NOAA/py_geometry/blob/master/py_geometry/line_crossings.pyx">https://github.com/ChrisBarker-NOAA/py_geometry/blob/master/py_geometry/line_crossings.pyx</a><br>

</div><div style><br></div><div style>I hope it's useful to you.</div><div style><br></div><div style>-Chris</div><div style><br></div><div style><br></div><div style>-Chris</div><div style><br></div><div style><br></div>

<div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style>-Chris</div><div style><br></div><div style><br></div><div style><br></div><div style>

<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:'times new roman','new york',times,serif">

<div><font></font></div><div><font>Any idea for that?</font></div><div><font><br></font></div><div><font>Thanks a lot!</font></div><div style="font-family:'times new roman','new york',times,serif;font-size:10pt">

<br></div></div></div><br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>

Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a>
</div></div>