<?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>Numpty&#039;s Progress &#187; angle</title>
	<atom:link href="http://glaikit.org/tag/angle/feed/" rel="self" type="application/rss+xml" />
	<link>http://glaikit.org</link>
	<description>lost, to five decimal places</description>
	<lastBuildDate>Wed, 01 Feb 2012 03:00:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>binning by angle</title>
		<link>http://glaikit.org/2011/11/25/binning-by-angle/</link>
		<comments>http://glaikit.org/2011/11/25/binning-by-angle/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 01:40:17 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[angle]]></category>
		<category><![CDATA[bin]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=648</guid>
		<description><![CDATA[I was trying to sort a series of polar coordinates by compass direction: everything in the N sector, then NNE, NE, ENE, E, &#8230; This is trickier than it looks, since the North sector includes angles between 348.75° and 11.25°. &#8230; <a href="http://glaikit.org/2011/11/25/binning-by-angle/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="standard" count="false" url="http://glaikit.org/2011/11/25/binning-by-angle/"></g:plusone></div><p>I was trying to sort a series of polar coordinates by compass direction: everything in the N sector, then NNE, NE, ENE, E, &#8230; This is trickier than it looks, since the North sector includes angles between 348.75° and 11.25°.</p>
<p>It&#8217;s easier to think of the problem instead of being one of <em>N</em> bins <span style="text-decoration: underline;">centred on</span> 0°, but rather one of <em>2N</em> bins <span style="text-decoration: underline;">starting at</span> 0°. Then, all one needs to do is shift everything round by one of these half bins (so +1, modulo <em>2N</em>), then divide the number of bins back to the number we want. Done!</p>
<p>Here&#8217;s some code to do it. It may look like C-like pseudocode, but it&#8217;s real live AWK:</p>
<pre>function bin(angle,nbins){
  return int(((int(angle/(360.0/(nbins*2)))+1)%(nbins*2))/2);
}</pre>
<p>You probably want the angles to be between 0..360°. But you knew that.</p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p> <p><a href="http://glaikit.org/?flattrss_redirect&amp;id=648&amp;md5=27b0b7b6e311d7baea57a35a90dabc9e" title="Flattr" target="_blank"><img src="http://glaikit.org/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2011/11/25/binning-by-angle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://glaikit.org/?flattrss_redirect&amp;id=648&amp;md5=27b0b7b6e311d7baea57a35a90dabc9e" type="text/html" />"
	</item>
		<item>
		<title>Toronto&#8217;s Angles</title>
		<link>http://glaikit.org/2010/03/10/torontos-angles/</link>
		<comments>http://glaikit.org/2010/03/10/torontos-angles/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 02:49:22 +0000</pubDate>
		<dc:creator>scruss</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[angle]]></category>
		<category><![CDATA[geod]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[intersection]]></category>
		<category><![CDATA[street]]></category>
		<category><![CDATA[toronto]]></category>

		<guid isPermaLink="false">http://glaikit.org/?p=143</guid>
		<description><![CDATA[As many Canadians will tell you, most Torontonians are a bit skewed. While others might have different explanations, I put it down to our road grid. What we call north in the city is actually some 16.7° west of north. &#8230; <a href="http://glaikit.org/2010/03/10/torontos-angles/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="standard" count="false" url="http://glaikit.org/2010/03/10/torontos-angles/"></g:plusone></div><p>As many Canadians will tell you, most Torontonians are a bit skewed. While others might have different explanations, I put it down to our road grid. What we call north in the city is actually some 16.7° west of north.</p>
<p>While we do have a perpendicular grid, it&#8217;s twisted to the left (steady, Edmontonians). I attempted to work out what the average angle is.</p>
<p>I eyeballed several long straight streets, and picked out representative intersections. Finidng the coordinates of these intersections took a surprisingly long time, as each street has several road sections. To find an intersection, each section on one road has to be queried against each section of the other. It gets there, eventually.</p>
<p>To save the tedium of showing the queries, here are the results. The angles are anticlockwise from the X-axis.</p>
<pre>N-S	 Intersection1 Intersection2 Angle
======== ============= ============= ======
Bathurst King	       Dupont	     16.184
Yonge	 King	       Rosehill	     16.783
Woodbine Queen	       Plains	     17.049

E-W	 Intersection1 Intersection2 Angle
======== ============= ============= ======
Danforth Greenwood     Main	     16.736
Eglinton Dufferin      Bayview	     16.159
Steeles	 Dufferin      Kennedy	     17.194
</pre>
<p>I was surprised that SpatiaLite didn&#8217;t have any angle measurement functions built in, so I had to feed the output through <a href="http://trac.osgeo.org/proj/wiki/man_geod">geod</a>. So for instance, for Steeles Avenue, the intersection of Steeles West and Dufferin is at 43.787229°N, 79.470285°W, and the intersection of Steeles East and Kennedy is 43.823636°N, 79.307265°W. Feeding these numbers to geod:</p>
<pre class="brush: plain; title: ; notranslate">echo '43.787229 -79.470285 43.823636 -79.307265'| geod +ellps=WGS84 -f &quot;%.3f&quot; -p -I +units=m</pre>
<p>This spits out three numbers: 72.806    252.918    13727.395. The first is the bearing from the first point to the second; this is the number we&#8217;re interested in, and it&#8217;s (90-82.806) = 17.194° clockwise from E. The second is the bearing from the second point back to the first. The last is the distance in metres; Steeles is a long, straight street.</p>
<p>Averaging the numbers for the streets I chose gets 16.684°; just the thing for <a href="http://www.walrusmagazine.com/blogs/2009/10/21/photography-contest-torontohenge/">Torontohenge</a>. For a visual axis, maybe using Steeles&#8217;s 17.194° could be better, as it&#8217;s a line above the city. You can set the map rotation angle in QGIS&#8217;s map composer, and get a better aligned city:</p>
<p><a href="http://glaikit.org/wp-content/uploads/2010/03/toronto_skewed.png"><img class="aligncenter size-full wp-image-154" title="toronto_skewed" src="http://glaikit.org/wp-content/uploads/2010/03/toronto_skewed.png" alt="" width="390" height="205" /></a></p>
<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p> <p><a href="http://glaikit.org/?flattrss_redirect&amp;id=143&amp;md5=98febf25fcf71caa407507ace3686ee0" title="Flattr" target="_blank"><img src="http://glaikit.org/wp-content/plugins/flattrss/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://glaikit.org/2010/03/10/torontos-angles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://glaikit.org/?flattrss_redirect&amp;id=143&amp;md5=98febf25fcf71caa407507ace3686ee0" type="text/html" />"
	</item>
	</channel>
</rss>

