<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:10pt"><div><span>Hi Chris.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>I wanna see if two line segments are connected by a path formed by line segments intersected.</span></div><div></div><div><br></div><div>Waiting for your answers.</div><div><br></div><div>Thanks a lot!</div><div><br></div><div><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 10pt;"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div dir="ltr"> <font size="2" face="Arial">
<b><span style="font-weight:bold;">De:</span></b> Chris Barker - NOAA Federal <chris.barker@noaa.gov><br> <b><span style="font-weight: bold;">Para:</span></b> Discussion of Numerical Python <numpy-discussion@scipy.org> <br> <b><span style="font-weight: bold;">Enviado:</span></b> domingo, 1 de septiembre de 2013 21:18<br> <b><span style="font-weight: bold;">Asunto:</span></b> Re: [Numpy-discussion] Stick intersection path algorithm<br> </font> </div> <div class="y_msg_container"><br><div id="yiv218635097"><div dir="ltr">On Sun, Sep 1, 2013 at 3:55 PM, Josè Luis Mietta <span dir="ltr"><<a rel="nofollow" ymailto="mailto:joseluismietta@yahoo.com.ar" target="_blank" href="mailto:joseluismietta@yahoo.com.ar">joseluismietta@yahoo.com.ar</a>></span> wrote:<br><div class="yiv218635097gmail_extra">
<div class="yiv218635097gmail_quote"><blockquote class="yiv218635097gmail_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;">
<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 rel="nofollow" target="_blank" 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 rel="nofollow" target="_blank" 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 rel="nofollow" target="_blank" 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="yiv218635097gmail_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;">
<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-size:10pt;">
<br></div></div></div><br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a rel="nofollow" ymailto="mailto:NumPy-Discussion@scipy.org" target="_blank" href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a rel="nofollow" target="_blank" href="http://mail.scipy.org/mailman/listinfo/numpy-discussion">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 rel="nofollow" ymailto="mailto:Chris.Barker@noaa.gov" target="_blank" href="mailto:Chris.Barker@noaa.gov">Chris.Barker@noaa.gov</a>
</div></div>
</div><br>_______________________________________________<br>NumPy-Discussion mailing list<br><a ymailto="mailto:NumPy-Discussion@scipy.org" 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><br></div> </div> </div> </div></body></html>