<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Line Segment Intersection Algorithm</title>
	<atom:link href="http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/</link>
	<description>The Adventures of a UCSB Computer Science Ph.D. Student</description>
	<lastBuildDate>Sat, 17 Jul 2010 00:07:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: T. Schwarz</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4981</link>
		<dc:creator>T. Schwarz</dc:creator>
		<pubDate>Mon, 07 Jun 2010 20:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4981</guid>
		<description>This is very elegant, indeed. Unfortunately, it only works well in the general case, where the two line segments are not parallel. And in this case, the 
intersection of the two lines can be calculated with Cramer&#039;s rule using 3 determinants, whereas the code calculates effectively 4 determinants.

Most of the coding work to be done needs to deal with special conditions such as line segment1 is contained in line segment2, or they lay on the same line, but do not intersect, e.g. (-5,0) to (-3,0) and (-1,0) and (1,0).</description>
		<content:encoded><![CDATA[<p>This is very elegant, indeed. Unfortunately, it only works well in the general case, where the two line segments are not parallel. And in this case, the<br />
intersection of the two lines can be calculated with Cramer&#8217;s rule using 3 determinants, whereas the code calculates effectively 4 determinants.</p>
<p>Most of the coding work to be done needs to deal with special conditions such as line segment1 is contained in line segment2, or they lay on the same line, but do not intersect, e.g. (-5,0) to (-3,0) and (-1,0) and (1,0).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doc</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4755</link>
		<dc:creator>doc</dc:creator>
		<pubDate>Mon, 07 Sep 2009 14:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4755</guid>
		<description>@lolhmm et al 

No it won&#039;t since you have to had different ccw results in tests ccw(A,C,D) != ccw(B,C,D) and ccw(A,B,C) != ccw(A,B,D), while for collinear case your code just treats collinearity as ccw.

I have rewritten ccw function to something like this (code in C/C++):
---
double ccw = (C(1) - A(1)) * (B(0) - A(0)) - (B(1) - A(1)) * (C(0) - A(0));
return ccw &gt; 0.0 ? 1 : ccw &lt; 0.0 ? -1 : 0;
---
A(0) is A.x, A(1) A.y and so on

Not havily tested yet but seems to work...</description>
		<content:encoded><![CDATA[<p>@lolhmm et al </p>
<p>No it won&#8217;t since you have to had different ccw results in tests ccw(A,C,D) != ccw(B,C,D) and ccw(A,B,C) != ccw(A,B,D), while for collinear case your code just treats collinearity as ccw.</p>
<p>I have rewritten ccw function to something like this (code in C/C++):<br />
&#8212;<br />
double ccw = (C(1) &#8211; A(1)) * (B(0) &#8211; A(0)) &#8211; (B(1) &#8211; A(1)) * (C(0) &#8211; A(0));<br />
return ccw &gt; 0.0 ? 1 : ccw &lt; 0.0 ? -1 : 0;<br />
&#8212;<br />
A(0) is A.x, A(1) A.y and so on</p>
<p>Not havily tested yet but seems to work&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Intel Threading Challenge &#8211; Problem 6: Line Segment Intersection &#8211; SLUUM</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4742</link>
		<dc:creator>Intel Threading Challenge &#8211; Problem 6: Line Segment Intersection &#8211; SLUUM</dc:creator>
		<pubDate>Wed, 12 Aug 2009 16:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4742</guid>
		<description>[...] we have a simple implementation of line segment intersection in the plane: source (based on http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/). Attached Files:line_interVN:F [1.6.1_878]please wait...Rating: 0.0/10 (0 votes cast)   This entry [...]</description>
		<content:encoded><![CDATA[<p>[...] we have a simple implementation of line segment intersection in the plane: source (based on <a href="http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/)" rel="nofollow">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/)</a>. Attached Files:line_interVN:F [1.6.1_878]please wait&#8230;Rating: 0.0/10 (0 votes cast)   This entry [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce Boe</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4647</link>
		<dc:creator>Bryce Boe</dc:creator>
		<pubDate>Wed, 01 Apr 2009 20:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4647</guid>
		<description>Random commenter:
&quot;If the slope of the line AB is less than the slope of the line AC then the three points are listed in a counterclockwise order.&quot;

If the slopes are equal then all three points are collinear and therefore no longer listed in a counterclockwise order which breaks this intersection algorithm.</description>
		<content:encoded><![CDATA[<p>Random commenter:<br />
&#8220;If the slope of the line AB is less than the slope of the line AC then the three points are listed in a counterclockwise order.&#8221;</p>
<p>If the slopes are equal then all three points are collinear and therefore no longer listed in a counterclockwise order which breaks this intersection algorithm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lolhmm</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4646</link>
		<dc:creator>lolhmm</dc:creator>
		<pubDate>Wed, 01 Apr 2009 19:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4646</guid>
		<description>Could the issue Tang pointed out be solved by altering the CCW test to;
((cy-ay*bx-ax)) &gt;= ((by-ay)*(cx-ax))

Sorry I didn&#039;t test before commenting, just came across this and thought it might do the trick. :p

Delete this comment if it&#039;s incorrect please, otherwise success!</description>
		<content:encoded><![CDATA[<p>Could the issue Tang pointed out be solved by altering the CCW test to;<br />
((cy-ay*bx-ax)) &gt;= ((by-ay)*(cx-ax))</p>
<p>Sorry I didn&#8217;t test before commenting, just came across this and thought it might do the trick. :p</p>
<p>Delete this comment if it&#8217;s incorrect please, otherwise success!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce Boe</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4272</link>
		<dc:creator>Bryce Boe</dc:creator>
		<pubDate>Tue, 23 Dec 2008 19:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4272</guid>
		<description>Good call Haibao, you are correct. This algorithm assumes the endpoints are not closed thus a test for collinearity is required to be complete.</description>
		<content:encoded><![CDATA[<p>Good call Haibao, you are correct. This algorithm assumes the endpoints are not closed thus a test for collinearity is required to be complete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haibao Tang</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4271</link>
		<dc:creator>Haibao Tang</dc:creator>
		<pubDate>Tue, 23 Dec 2008 17:35:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4271</guid>
		<description>This method does not handle the case where an end-point of one segment is inside another segment, in which case the &#039;counter-clock-wiseness&#039; is undefined ... for example, add this line in your script &quot;print intersect(a,d,c,d)&quot; will return False, which obviously is incorrect.</description>
		<content:encoded><![CDATA[<p>This method does not handle the case where an end-point of one segment is inside another segment, in which case the &#8216;counter-clock-wiseness&#8217; is undefined &#8230; for example, add this line in your script &#8220;print intersect(a,d,c,d)&#8221; will return False, which obviously is incorrect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce Boe</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4168</link>
		<dc:creator>Bryce Boe</dc:creator>
		<pubDate>Mon, 08 Dec 2008 20:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4168</guid>
		<description>Hammoudeh,
Thanks for the comment. The email on the python list is a ridiculous amount of code to solve the problem. I&#039;m glad you were able to find a more elegant solution.</description>
		<content:encoded><![CDATA[<p>Hammoudeh,<br />
Thanks for the comment. The email on the python list is a ridiculous amount of code to solve the problem. I&#8217;m glad you were able to find a more elegant solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hammoudeh</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-4165</link>
		<dc:creator>Hammoudeh</dc:creator>
		<pubDate>Mon, 08 Dec 2008 16:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-4165</guid>
		<description>cool. I was using the code provided from: http://mail.python.org/pipermail/python-list/2000-November/059143.html
but your solution is much shorter and easier to understand.
Good job</description>
		<content:encoded><![CDATA[<p>cool. I was using the code provided from: <a href="http://mail.python.org/pipermail/python-list/2000-November/059143.html" rel="nofollow">http://mail.python.org/pipermail/python-list/2000-November/059143.html</a><br />
but your solution is much shorter and easier to understand.<br />
Good job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cheri</title>
		<link>http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/comment-page-1/#comment-92</link>
		<dc:creator>Cheri</dc:creator>
		<pubDate>Fri, 27 Oct 2006 00:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryceboe.com/2006/10/23/line-segment-intersection-algorithm/#comment-92</guid>
		<description>What the heck are you even talking about?  :)  Tom said this was cool.  I&#039;ll have to take his word for it since I&#039;m merely a non-practicing lawyer.  Good job on the copyright notice at the bottom of your weblog.  I&#039;ve taught you well, Grasshopper.  Okay, it probably wasn&#039;t me who told you to do that, but still, good job.</description>
		<content:encoded><![CDATA[<p>What the heck are you even talking about?  <img src='http://www.bryceboe.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Tom said this was cool.  I&#8217;ll have to take his word for it since I&#8217;m merely a non-practicing lawyer.  Good job on the copyright notice at the bottom of your weblog.  I&#8217;ve taught you well, Grasshopper.  Okay, it probably wasn&#8217;t me who told you to do that, but still, good job.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.255 seconds -->
