﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Keith Hair &#187; SciFi</title>
	<atom:link href="http://keith-hair.net/blog/category/scifi/feed/" rel="self" type="application/rss+xml" />
	<link>http://keith-hair.net/blog</link>
	<description>Scripting is fun like any other hobby</description>
	<lastBuildDate>Mon, 17 May 2010 16:02:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Knowing if a Point is behind a Line</title>
		<link>http://keith-hair.net/blog/2009/05/27/knowing-if-a-point-is-behind-a-line/</link>
		<comments>http://keith-hair.net/blog/2009/05/27/knowing-if-a-point-is-behind-a-line/#comments</comments>
		<pubDate>Wed, 27 May 2009 21:15:01 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[SciFi]]></category>
		<category><![CDATA[Behind]]></category>
		<category><![CDATA[Line]]></category>
		<category><![CDATA[Points]]></category>
		<category><![CDATA[Test]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=58</guid>
		<description><![CDATA[Yea yea, I know Battlestar Galactica is over, but today I thought of the "Daybreak part 1" episode of BSG. Hera, a little girl has been kidnapped by the Cylons. As part of a desperate plan to save Hera, Admiral Adama draws a red line on the deck, and asks for those willing to risk [...]]]></description>
			<content:encoded><![CDATA[<p>Yea yea, I know Battlestar Galactica is over, but today I thought of the <a href="http://www.scifi.com/battlestar/episodes/episodes.php?seas=4&#038;ep=421&#038;act=3">"Daybreak part 1" episode of BSG</a>.<br />
Hera, a little girl has been kidnapped by the Cylons. As part of a desperate plan to save Hera, Admiral Adama draws a red line on the deck, and asks for those willing to risk their lives to save her, do so by crossing the line.</p>
<p>I had a similar problem also with my scripts. I wanted to simply know if a Point was behind a Line or not... <img src='http://keith-hair.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_behind_line_2075893172"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="/blog/examples/intersections/behind_line.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/blog/examples/intersections/behind_line.swf"
			name="fm_behind_line_2075893172"
			width="550"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><span id="more-58"></span></p>
<pre class="actionscript">&nbsp;
<span style="color: #808080; font-style: italic;">/*-----------------------------------------------------------------
Returns true if Point P is behind line defined by Points C and D.
 ----------------------------------------------------------------*/</span>
<span style="color: #000000; font-weight: bold;">function</span> isBehindLine<span style="color: #66cc66;">&#40;</span>P:Point,C:Point,D:Point<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">Number</span>=Point.<span style="color: #006600;">distance</span><span style="color: #66cc66;">&#40;</span>P,C.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>Point.<span style="color: #006600;">polar</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">atan2</span><span style="color: #66cc66;">&#40;</span>C.<span style="color: #006600;">y</span> - D.<span style="color: #006600;">y</span>,C.<span style="color: #006600;">x</span> - D.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> / <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> b:<span style="color: #0066CC;">Number</span>=Point.<span style="color: #006600;">distance</span><span style="color: #66cc66;">&#40;</span>P,C.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>Point.<span style="color: #006600;">polar</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">-1</span>,<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">atan2</span><span style="color: #66cc66;">&#40;</span>C.<span style="color: #006600;">y</span> - D.<span style="color: #006600;">y</span>,C.<span style="color: #006600;">x</span> - D.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> / <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> a &lt; b;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2009/05/27/knowing-if-a-point-is-behind-a-line/&ztz=Knowing if a Point is behind a Line'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2009/05/27/knowing-if-a-point-is-behind-a-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cylons vs Terminators</title>
		<link>http://keith-hair.net/blog/2008/10/15/cylons-vs-terminators/</link>
		<comments>http://keith-hair.net/blog/2008/10/15/cylons-vs-terminators/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 01:36:19 +0000</pubDate>
		<dc:creator>Keith H</dc:creator>
				<category><![CDATA[SciFi]]></category>
		<category><![CDATA[Cylons]]></category>
		<category><![CDATA[polls]]></category>
		<category><![CDATA[Terminator]]></category>

		<guid isPermaLink="false">http://keith-hair.net/blog/?p=26</guid>
		<description><![CDATA[Judging by intelligence and strength, which robot life form would win in a battle to extinction? ( polls)Both machines have demonstrated creative uses of intelligent strategy and brute force in various movies and TV shows. All specs and info from movies and literature is fair game...so who do you'd think would win and why.]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" language="javascript" src="http://s3.polldaddy.com/p/1000117.js"></script><noscript> <a href ="http://answers.polldaddy.com/poll/1000117/" >Judging by intelligence and strength, which robot life form would win in a battle to extinction?</a>  <br/> <span style="font-size:9px;"> (<a href ="http://www.polldaddy.com">  polls</a>)</span></noscript>Both machines have demonstrated creative uses of intelligent strategy and brute force in various movies and TV shows.<br />
All specs and info from movies and literature is fair game...so who do you'd think would win and why.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=&zqz=&zurlz=http://keith-hair.net/blog/2008/10/15/cylons-vs-terminators/&ztz=Cylons vs Terminators'><img src='http://keith-hair.net/blog/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a>]]></content:encoded>
			<wfw:commentRss>http://keith-hair.net/blog/2008/10/15/cylons-vs-terminators/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
