<?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>The Rambling Chronicles: Notes &#187; C++</title>
	<atom:link href="http://notes.theramblingchronicles.co.uk/tags/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.theramblingchronicles.co.uk</link>
	<description>Making sense is optional</description>
	<lastBuildDate>Thu, 26 Aug 2010 10:09:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C++ Matrix Rotation</title>
		<link>http://notes.theramblingchronicles.co.uk/2008/03/04/geometric-matrix-rotation/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2008/03/04/geometric-matrix-rotation/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 22:21:05 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Matrices]]></category>

		<guid isPermaLink="false">http://www.tflash.co.uk/posts/20</guid>
		<description><![CDATA[Maths Alert! A bit of background is needed on this one: I was attempting to take a bunch of coordinates and rotate them around a circle on the z axis. Simple. No, it&#8217;s not when you know how to do the maths (matrix based rotations) on paper, but you have no idea how to apply [...]]]></description>
			<content:encoded><![CDATA[<p><span style="padding: 5px; background-color: #ee8262">Maths Alert!</span></p>

<p>A bit of background is needed on this one: I was attempting to take a bunch of coordinates and rotate them around a circle on the z axis. Simple. No, it&#8217;s not when you know how to do the maths (matrix based rotations) on paper, but you have no idea how to apply the maths knowledge to a <em>programmatic </em>solution. After lots of searches of functions that looked extremely complicated and feature rich (I wanted simple, one function code), I finally discovered the answer:</p>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">x1 <span style="color: #339933;">=</span> cos<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>x <span style="color: #339933;">-</span> sin<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>y<span style="color: #339933;">;</span>
y1 <span style="color: #339933;">=</span> sin<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>x <span style="color: #339933;">+</span> cos<span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>y<span style="color: #339933;">;</span></pre></div></div>




<p>What this basically does it take your two points, <code>x</code> and <code>y</code>, and rotate them by the amount given as <code>angle</code>, storing the new values in <code>x1</code> and <code>y1</code>. You need to have <code>x</code> and <code>y</code> to begin with, as it needs something to rotate.</p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2008/03/04/geometric-matrix-rotation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ cout</title>
		<link>http://notes.theramblingchronicles.co.uk/2008/01/30/c-cout/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2008/01/30/c-cout/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:21:14 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[asides]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.tflash.co.uk/posts/15</guid>
		<description><![CDATA[Useful tip for C++ programmers who&#8217;ve come from a different language like Python, Java etc. Use cout &#38;lt;&#38;lt; &#34;some text&#34; &#38;lt;&#38;lt; aVariable; instead of trying to concatenate (join) the strings like you would in PHP, Python, Java etc. Trying to join the variable (if it&#8217;s not already a string) to a string is overly complex [...]]]></description>
			<content:encoded><![CDATA[<p>Useful tip for C++ programmers who&#8217;ve come from a different language like Python, Java etc.<br />
Use <code>cout &amp;lt;&amp;lt; &quot;some text&quot; &amp;lt;&amp;lt; aVariable;</code> instead of trying to concatenate (join) the strings like you would in <span class="caps">PHP,</span> Python, Java etc. Trying to join the variable (if it&#8217;s not already a string) to a string is overly complex if your aim is just to write out the result of a calculation or something for debugging.</p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2008/01/30/c-cout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
