parallelvisions between information and perception

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 を適当な間隔で計算してプロットすれば大圏航路を描くことができる。日本の全航空路線にこれを適用したものが上の画像だが、日本くらいの範囲だと直線で結んだものとあまり変わらないかもしれない。いちおう両方をアップしておく

逆三角関数は頭痛を誘発するので以下をありがたく参考にした。

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Tumblr
  • TwitThis

@Replyin – Twitter translation bot

sayitin

My another (and maybe more useful) twitter bot. Some people might thought the same thing and might have already made better ones, but it’s OK with me. I made @replyin, a translator bot for over 40 languages.

Usage

1. Post a reply to @replyin

@replyin es...

Message should be @replyin [space] language [space] text.

Language name is better in 2-letter code as es, fr, de, ja etc., but ordinary English word such as french or Japanese will also work.

@replyin spanish...

If you want to specify the original language, try [original language]-[target language] like:

@replyin en-es...

english-french or Japanese-Norwegian will also work.

2. Wait a minute or two.

You will receive a reply from @replyin like this.

reply from @replyin

Currently it chats with my another bot @TonyMontanaBot for test. Sorry for dirty words.

@replyin uses Google Translate Service.

Note: For some reason this bot may be dead from time to time without notice and I can’t guarantee the quality of translation.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Tumblr
  • TwitThis

TonyMontanaBot/トニー・モンタナボット

From Scarface (1983)

From Scarface (1983)

Say hello to my little twitter bot.

I am not twitter-er, but recently I made my first twitter bot just for fun. Scarface’s infamous protagonist will spout his memorable lines randomly and also as a reply to any @TonyMontanaBot message.

『スカーフェイス』(1983) でお馴染みのトニー・モンタナのボットをつくった。一定時間ごとにセリフを吐くほか、@TonyMontanaBot に何かつぶやくと応えてくれる…はず。

Service_Twitter を利用。

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Tumblr
  • TwitThis

All the Airlines in Japan/日本の全航空路線

All the Airlines in Japan (oblique view)

All the Airlines in Japan (oblique view)

The red lines show all the commercial airlines in Japan. See detail here.

日本の全航空路線。

使用したデータは空港の緯度経度・路線の情報・日本地図(いずれも Wikipedia およびフリーの素材を使用)。軌跡は出発点と到着地を放物線で結んだもので実際の航路ではない。

平面にしたものなどはこちら

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Tumblr
  • TwitThis

Words in movies/映画のセリフであそぶ

Words in movies

Words in movies

What if all the lines of the movie are shown as a timeline?  See detail here.

映画のセリフを抜き出して時系列に配置してみる。

詳細はこちら

ときどき決めゼリフとか主人公の口癖が耳に残る映画があるが、どれくらいの頻度でいつ言っているのかふと疑問に思ったのがきっかけ。もう少し面白い単語・映画があるとは思うがとりあえず思いついた 5 本分ほどを作成。次回は恋愛映画を複数まとめて愛を語っている時間帯でも調べてみるか。

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Tumblr
  • TwitThis

After →