parallelvisions between information and perception

Posts from May 2009

All the Airlines in Japan – round version

Inspired by Circos.
以前のものは

All the Airlines in Japan
大圏航路の計算
日本の全航空路線

などにメモあり。


Posted
30 May 2009 @ 6pm

Tagged
Graphics

Drawing with php-gd #3

Original found in Wikimedia Commons.


Drawing with php-gd #2

Original photo found in Wikimedia Commons.


Posted
27 May 2009 @ 6pm

Tagged
Graphics

Drawing with php-gd/gdで描く #1

Dimension of the result image is 3983 * 2720 pixel (same as the original shown below). Drawn all by lines and all the lines are drawn with one stroke, i.e. each line start from the end point of the previous one. Number of the points is around 250,000.
Original photo by Luc Viatour, found in  Wikimedia [...]


Calculation of the great circle/大圏航路の計算

以前の日本の航空路線プロットはあらかじめ地球を平面と仮定し、出発点と到着地を三次元放物線で結んだものだったが、通常航路の描画に使われる(そして実際の飛行機が近似の線上を飛ぶ)のは球面上の大圏航路である。というわけで大圏航路バージョンを作成してみた。2地点の経度緯度が与えられたときの大圏航路の導出法は以下。
2地点の経度緯度をそれぞれ
(lon1, lat1), (lon2, lat2)
とすると、この2点間の中心角は
d = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))
とかける。角度はラジアン。値 f の0から1までの変化を2点間の移動に相当するとして、経路上の経度緯度は以下のように求められる。
A = sin((1-f)*d)/sin(d)
B = sin(f*d)/sin(d)
x = A*cos(lat1)*cos(lon1) + B*cos(lat2)*cos(lon2)
y = A*cos(lat1)*sin(lon1) + B*cos(lat2)*sin(lon2)
z = A*sin(lat1) + B*sin(lat2)
lat = atan2(z,sqrt(x^2+y^2))
lon = atan2(y,x)
これで f を適当な間隔で計算してプロットすれば大圏航路を描くことができる。日本の全航空路線にこれを適用したものが上の画像だが、日本くらいの範囲だと直線で結んだものとあまり変わらないかもしれない。いちおう両方をアップしておく。
逆三角関数は頭痛を誘発するので以下をありがたく参考にした。

http://www.astro.uu.nl/~strous/AA/en/reken/grootcirkel.html
http://iphylo.blogspot.com/2007/06/earth-not-flat-official.html


← Before