<?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: Visualizing TED Global (Now with 100% more TED Jokes)</title>
	<atom:link href="http://blog.blprnt.com/blog/blprnt/visualizing-ted-global-now-with-100-more-ted-jokes/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.blprnt.com/blog/blprnt/visualizing-ted-global-now-with-100-more-ted-jokes</link>
	<description>Jer Thorp &#124; There is an art to evolution...</description>
	<lastBuildDate>Wed, 28 Jul 2010 15:35:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Jer</title>
		<link>http://blog.blprnt.com/blog/blprnt/visualizing-ted-global-now-with-100-more-ted-jokes/comment-page-1#comment-909</link>
		<dc:creator>Jer</dc:creator>
		<pubDate>Mon, 20 Jul 2009 15:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blprnt.com/?p=820#comment-909</guid>
		<description>Hi John,

Mapping to a globe is a lot easier than mapping to a flat projection. Latitude and longitude are essentially spherical coordinates (http://en.wikipedia.org/wiki/Spherical_coordinate_system). Once you convert them to radians, you can use some really simple math to extract cartesian (x,y,z) coords. 

In my case I pass a 2D vector of lat,lon to two different functions, first to convert to spherical coords then to convert to cartesian:

Vec3D latToSphere(Vec2D ll, float r) {

   Vec3D v = new Vec3D();
   ll = toRadians(ll.x, ll.y);
   v.x = ll.x;
   v.y = ll.y - PI/2;
   v.z = r;
   
  return(v);    
};

Vec3D sphereToCart(Vec3D ll) {
  
  Vec3D v = new Vec3D();
  v.x = ll.z * cos(ll.y) * sin(ll.x);
  v.y = ll.z * sin(ll.y) * sin(ll.x);
  v.z = ll.z  * cos(ll.x);
  
  return(v); 
 
};

float degreesToRadians(float d) {
  return((d/180) * PI);
};

This gives me a 3D vector with the X,Y,Z coords. Both this vector and the spherical 3D vector are really useful since I can use some of the built-in methods of the Vec3D Class (thanks, toxi!) to do a lot of the math required to make the pretty ribbons, calculate distances, etc.

Toxi&#039;s geomutils are really really handy for this and a whole pile of other things: http://code.google.com/p/toxiclibs/


</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>Mapping to a globe is a lot easier than mapping to a flat projection. Latitude and longitude are essentially spherical coordinates (<a href="http://en.wikipedia.org/wiki/Spherical_coordinate_system" rel="nofollow">http://en.wikipedia.org/wiki/Spherical_coordinate_system</a>). Once you convert them to radians, you can use some really simple math to extract cartesian (x,y,z) coords. </p>
<p>In my case I pass a 2D vector of lat,lon to two different functions, first to convert to spherical coords then to convert to cartesian:</p>
<p>Vec3D latToSphere(Vec2D ll, float r) {</p>
<p>   Vec3D v = new Vec3D();<br />
   ll = toRadians(ll.x, ll.y);<br />
   v.x = ll.x;<br />
   v.y = ll.y &#8211; PI/2;<br />
   v.z = r;</p>
<p>  return(v);<br />
};</p>
<p>Vec3D sphereToCart(Vec3D ll) {</p>
<p>  Vec3D v = new Vec3D();<br />
  v.x = ll.z * cos(ll.y) * sin(ll.x);<br />
  v.y = ll.z * sin(ll.y) * sin(ll.x);<br />
  v.z = ll.z  * cos(ll.x);</p>
<p>  return(v); </p>
<p>};</p>
<p>float degreesToRadians(float d) {<br />
  return((d/180) * PI);<br />
};</p>
<p>This gives me a 3D vector with the X,Y,Z coords. Both this vector and the spherical 3D vector are really useful since I can use some of the built-in methods of the Vec3D Class (thanks, toxi!) to do a lot of the math required to make the pretty ribbons, calculate distances, etc.</p>
<p>Toxi&#8217;s geomutils are really really handy for this and a whole pile of other things: <a href="http://code.google.com/p/toxiclibs/" rel="nofollow">http://code.google.com/p/toxiclibs/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Brennan</title>
		<link>http://blog.blprnt.com/blog/blprnt/visualizing-ted-global-now-with-100-more-ted-jokes/comment-page-1#comment-908</link>
		<dc:creator>John Brennan</dc:creator>
		<pubDate>Mon, 20 Jul 2009 14:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blprnt.com/?p=820#comment-908</guid>
		<description>Great work Jer!

I&#039;ve used the metacarta api myself, but never poked around processing yet (although ProcessingJS is pretty wonderful).. something I&#039;ve added to my todo list.

I&#039;m really curious as to how you mapped a lat/long to an image of the globe.  Did you use the Google Earth API?  I know you&#039;ve talked about the Wolfram projections... but can you be a bit more specific?

cheers!
john
@worldlyjohn</description>
		<content:encoded><![CDATA[<p>Great work Jer!</p>
<p>I&#8217;ve used the metacarta api myself, but never poked around processing yet (although ProcessingJS is pretty wonderful).. something I&#8217;ve added to my todo list.</p>
<p>I&#8217;m really curious as to how you mapped a lat/long to an image of the globe.  Did you use the Google Earth API?  I know you&#8217;ve talked about the Wolfram projections&#8230; but can you be a bit more specific?</p>
<p>cheers!<br />
john<br />
@worldlyjohn</p>
]]></content:encoded>
	</item>
</channel>
</rss>
