<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: The beginnings of a real-time strategy game in Haskell</title>
	<atom:link href="http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/feed/" rel="self" type="application/rss+xml" />
	<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/</link>
	<description>Not quite insightful</description>
	<lastBuildDate>Sun, 18 Oct 2009 18:55:39 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Armada on Hackage &#171; Integer Overflow</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-716</link>
		<dc:creator>Armada on Hackage &#171; Integer Overflow</dc:creator>
		<pubDate>Tue, 06 Jan 2009 09:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-716</guid>
		<description>[...] Integer Overflow Not quite insightful   Skip to content AboutKineticFactorizationThe RSA&#160;Cryptosystem     &#171; The beginnings of a real-time strategy game in&#160;Haskell [...]</description>
		<content:encoded><![CDATA[<p>[...] Integer Overflow Not quite insightful   Skip to content AboutKineticFactorizationThe RSA&nbsp;Cryptosystem     &laquo; The beginnings of a real-time strategy game in&nbsp;Haskell [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Piponi</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-715</link>
		<dc:creator>Dan Piponi</dc:creator>
		<pubDate>Sun, 04 Jan 2009 04:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-715</guid>
		<description>Just a minor point Cale. In principle you can use quaternions to represent a scaling and rotation, but it&#039;s &#039;unnatural&#039;. If r is a quaternion for a rotation, and q is xi+yj+zk, then you usually apply the rotation by mapping q -&gt; rqr^(-1). If the quaternion has a scaling on it, this mapping essentially discards it. So quaternions are usually used to represent just rotations.</description>
		<content:encoded><![CDATA[<p>Just a minor point Cale. In principle you can use quaternions to represent a scaling and rotation, but it&#8217;s &#8216;unnatural&#8217;. If r is a quaternion for a rotation, and q is xi+yj+zk, then you usually apply the rotation by mapping q -&gt; rqr^(-1). If the quaternion has a scaling on it, this mapping essentially discards it. So quaternions are usually used to represent just rotations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: intoverflow</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-714</link>
		<dc:creator>intoverflow</dc:creator>
		<pubDate>Sat, 03 Jan 2009 21:09:35 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-714</guid>
		<description>Cale hit the nail on the head.  The types are the same; a pair of Doubles (a,b) is the same as (a :+ b), just with different notation.

The complex numbers come with a few advantages in Haskell, though.  One is that they have an additive structure, whereas tuples do not already have an addition provided.  Another is that the complex numbers come with a norm (the &lt;code&gt;magnitude&lt;/code&gt; function), which tuples don&#039;t come with.  All of this could be implemented for tuples, but why add code when we can just use a type that already has the desired functionality?</description>
		<content:encoded><![CDATA[<p>Cale hit the nail on the head.  The types are the same; a pair of Doubles (a,b) is the same as (a :+ b), just with different notation.</p>
<p>The complex numbers come with a few advantages in Haskell, though.  One is that they have an additive structure, whereas tuples do not already have an addition provided.  Another is that the complex numbers come with a norm (the <code>magnitude</code> function), which tuples don&#8217;t come with.  All of this could be implemented for tuples, but why add code when we can just use a type that already has the desired functionality?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cale Gibbard</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-713</link>
		<dc:creator>Cale Gibbard</dc:creator>
		<pubDate>Sat, 03 Jan 2009 20:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-713</guid>
		<description>Adam: Oh, just realised that I hadn&#039;t answered your other question. For the purposes you&#039;re describing, complex numbers (a+b*i) can simply be thought of as vectors (a,b). Addition of complex numbers is addition of vectors, multiplication of a complex number by a real number is scalar multiplication.

However, in addition to that, we have that multiplication of a complex number by a complex number on the unit circle will not change the magnitude, but will rotate according to the angle from the positive real axis. The complex numbers on the unit circle can be obtained nicely by applying the natural exponential function exp to imaginary numbers (complex numbers with zero real part). exp(t*i) is the unit complex number which is at angle t from the positive real axis, counterclockwise. For example, exp(pi*i) = -1, exp(pi/2 * i) = i, and exp(pi/4 * i) = (1 + i)/sqrt(2).</description>
		<content:encoded><![CDATA[<p>Adam: Oh, just realised that I hadn&#8217;t answered your other question. For the purposes you&#8217;re describing, complex numbers (a+b*i) can simply be thought of as vectors (a,b). Addition of complex numbers is addition of vectors, multiplication of a complex number by a real number is scalar multiplication.</p>
<p>However, in addition to that, we have that multiplication of a complex number by a complex number on the unit circle will not change the magnitude, but will rotate according to the angle from the positive real axis. The complex numbers on the unit circle can be obtained nicely by applying the natural exponential function exp to imaginary numbers (complex numbers with zero real part). exp(t*i) is the unit complex number which is at angle t from the positive real axis, counterclockwise. For example, exp(pi*i) = -1, exp(pi/2 * i) = i, and exp(pi/4 * i) = (1 + i)/sqrt(2).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cale Gibbard</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-712</link>
		<dc:creator>Cale Gibbard</dc:creator>
		<pubDate>Sat, 03 Jan 2009 20:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-712</guid>
		<description>Adam: The reason for using complex numbers is that complex multiplication has a very nice geometric interpretation as a combination of rotation and scaling. It makes geometric computation (at least in 2 dimensions) much nicer.

For 3 dimensions, you don&#039;t get such a nice algebra, though the quaternions, a 4-dimensional algebra, can be used to represent orientations and scalings in 3D (via conjugation and a particular embedding of 3D space into the quaternions).</description>
		<content:encoded><![CDATA[<p>Adam: The reason for using complex numbers is that complex multiplication has a very nice geometric interpretation as a combination of rotation and scaling. It makes geometric computation (at least in 2 dimensions) much nicer.</p>
<p>For 3 dimensions, you don&#8217;t get such a nice algebra, though the quaternions, a 4-dimensional algebra, can be used to represent orientations and scalings in 3D (via conjugation and a particular embedding of 3D space into the quaternions).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://intoverflow.wordpress.com/2009/01/02/the-beginnings-of-a-real-time-strategy-game-in-haskell/#comment-711</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sat, 03 Jan 2009 19:48:52 +0000</pubDate>
		<guid isPermaLink="false">http://intoverflow.wordpress.com/?p=241#comment-711</guid>
		<description>What is your rationale for using complex numbers instead of 2d vectors? Maybe it&#039;s just that I&#039;m used to thinking about this in a graphical sense, (or don&#039;t know enough math) but I can&#039;t come up with a solid reason for it.

E.G. a common method for implementing unit movement is to have a per-tick fractional unit speed (scalar) that is multiplied by the normal of the units intended heading, which is then added to the unit position to determine the new location for that tick. This has the distinct advantage of not allowing diagonal movement to be faster than movement in a single direction. How would a movement system based on complex numbers handle this issue?</description>
		<content:encoded><![CDATA[<p>What is your rationale for using complex numbers instead of 2d vectors? Maybe it&#8217;s just that I&#8217;m used to thinking about this in a graphical sense, (or don&#8217;t know enough math) but I can&#8217;t come up with a solid reason for it.</p>
<p>E.G. a common method for implementing unit movement is to have a per-tick fractional unit speed (scalar) that is multiplied by the normal of the units intended heading, which is then added to the unit position to determine the new location for that tick. This has the distinct advantage of not allowing diagonal movement to be faster than movement in a single direction. How would a movement system based on complex numbers handle this issue?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
