<?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></description>
	<lastBuildDate>Fri, 23 Dec 2011 14:10:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Michael</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-981</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sat, 17 Dec 2011 21:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-981</guid>
		<description>Just wanted to add that i have tried Keith Hairs code and it seems to work much better:
http://keith-hair.net/blog/2008/08/04/find-intersection-point-of-two-lines-in-as3/</description>
		<content:encoded><![CDATA[<p>Just wanted to add that i have tried Keith Hairs code and it seems to work much better:<br />
<a href="http://keith-hair.net/blog/2008/08/04/find-intersection-point-of-two-lines-in-as3/" rel="nofollow">http://keith-hair.net/blog/2008/08/04/find-intersection-point-of-two-lines-in-as3/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-980</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sat, 17 Dec 2011 21:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-980</guid>
		<description>Sorry, your code doesn&#039;t work.

// this will give null
var p1= new Point(x=343.4729858398438, y=351.9473937988281);
var p2= new Point(x=628.6473937988281, y=351.9473937988281);
var p3= new Point(x=486.06018981933596, y=494.5345977783203);
var p4= new Point(x=486.06018981933596, y=209.36018981933594);
trace (intersection(p1,p2,p3,p4)); 

// but this will draw two intersecting lines
graphics.lineStyle(1);
graphics.moveTo(p1.x,p1.y);
graphics.lineTo(p2.x,p2.y);
graphics.moveTo(p3.x,p3.y);
graphics.lineTo(p4.x,p4.y);</description>
		<content:encoded><![CDATA[<p>Sorry, your code doesn&#8217;t work.</p>
<p>// this will give null<br />
var p1= new Point(x=343.4729858398438, y=351.9473937988281);<br />
var p2= new Point(x=628.6473937988281, y=351.9473937988281);<br />
var p3= new Point(x=486.06018981933596, y=494.5345977783203);<br />
var p4= new Point(x=486.06018981933596, y=209.36018981933594);<br />
trace (intersection(p1,p2,p3,p4)); </p>
<p>// but this will draw two intersecting lines<br />
graphics.lineStyle(1);<br />
graphics.moveTo(p1.x,p1.y);<br />
graphics.lineTo(p2.x,p2.y);<br />
graphics.moveTo(p3.x,p3.y);<br />
graphics.lineTo(p4.x,p4.y);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-514</link>
		<dc:creator>Lucas</dc:creator>
		<pubDate>Tue, 11 Oct 2011 05:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-514</guid>
		<description>if you use int instead of number works well =)</description>
		<content:encoded><![CDATA[<p>if you use int instead of number works well =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-513</link>
		<dc:creator>Lucas</dc:creator>
		<pubDate>Tue, 11 Oct 2011 05:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-513</guid>
		<description>trace(new GLine(475.5, 468.05, 475.5, 468.05 + 57.099999999999966).intersectsLinePoints(pA, pB)); // this return null</description>
		<content:encoded><![CDATA[<p>trace(new GLine(475.5, 468.05, 475.5, 468.05 + 57.099999999999966).intersectsLinePoints(pA, pB)); // this return null</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-510</link>
		<dc:creator>Lucas</dc:creator>
		<pubDate>Mon, 10 Oct 2011 23:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-510</guid>
		<description>I create framework with this code, and i have problem to specific coors:


var r:GRectangle = new GRectangle(475.5, 468.05, 475.5 + 52.39999999999998, 468.05 + 57.099999999999966);
var pA:GPoint = new GPoint(183, 504);
var pB:GPoint = new GPoint(883, 504);
trace(r.intersectsLinePoints(pA, pB)); // return FALSE</description>
		<content:encoded><![CDATA[<p>I create framework with this code, and i have problem to specific coors:</p>
<p>var r:GRectangle = new GRectangle(475.5, 468.05, 475.5 + 52.39999999999998, 468.05 + 57.099999999999966);<br />
var pA:GPoint = new GPoint(183, 504);<br />
var pB:GPoint = new GPoint(883, 504);<br />
trace(r.intersectsLinePoints(pA, pB)); // return FALSE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robbe</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-49</link>
		<dc:creator>Robbe</dc:creator>
		<pubDate>Sat, 05 Mar 2011 10:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-49</guid>
		<description>Thanks! This will really come in handy.
(and also thanks john for pointing out the performance thingy, because I was about to go and test it myself :o)</description>
		<content:encoded><![CDATA[<p>Thanks! This will really come in handy.<br />
(and also thanks john for pointing out the performance thingy, because I was about to go and test it myself :o)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-48</link>
		<dc:creator>john</dc:creator>
		<pubDate>Fri, 10 Dec 2010 20:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=104#comment-48</guid>
		<description>over 1 1/2 years... THANKS! this is a really fast function, It out performs Keith Hairs version which i was currently using.</description>
		<content:encoded><![CDATA[<p>over 1 1/2 years&#8230; THANKS! this is a really fast function, It out performs Keith Hairs version which i was currently using.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://flassari.is/2009/04/line-line-intersection-in-as3/#comment-47</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-47</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>

