<?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-Line Intersection in AS3</title>
	<atom:link href="http://flassari.is/2009/04/line-line-intersection-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://flassari.is/2009/04/line-line-intersection-in-as3/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 01 Sep 2010 20:24:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Adam</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/comment-page-1/#comment-14</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Mon, 13 Jul 2009 20:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-14</guid>
		<description>Before using this for something like collision detection in a game, you will want to expand your analysis for the cases where your determinant is zero. A zero determinant (d==0) tells you there is no UNIQUE point of intersection between the lines passing through your points. The lines are either parallel or collinear. But... your function is not a line-line intersection function, it&#039;s really a line segment intersection function, so there are more cases to breakdown when d==0:

You could have a valid intersection if the line segments are collinear and share a point. Consider the simple case where all 4 points are on the same line, and the segments share an endpoint. Your function will return null, but it really should return the intersection point (the common endpoint). Ditto for the completely degenerate case where p1==p2==p3==p4.

In the case where your segments are collinear and overlap by more than an endpoint, the most correct thing to do would be to return the segment that represents the intersection. This will require a more general return type (a segment type, i.e. two points).</description>
		<content:encoded><![CDATA[<p>Before using this for something like collision detection in a game, you will want to expand your analysis for the cases where your determinant is zero. A zero determinant (d==0) tells you there is no UNIQUE point of intersection between the lines passing through your points. The lines are either parallel or collinear. But&#8230; your function is not a line-line intersection function, it&#8217;s really a line segment intersection function, so there are more cases to breakdown when d==0:</p>
<p>You could have a valid intersection if the line segments are collinear and share a point. Consider the simple case where all 4 points are on the same line, and the segments share an endpoint. Your function will return null, but it really should return the intersection point (the common endpoint). Ditto for the completely degenerate case where p1==p2==p3==p4.</p>
<p>In the case where your segments are collinear and overlap by more than an endpoint, the most correct thing to do would be to return the segment that represents the intersection. This will require a more general return type (a segment type, i.e. two points).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
