Quaternions are peculiar. They are something I'm happy to use if a tool offers them, and are fascinating to explore conceptually, but I wouldn't normally implement them myself except for learning purposes. They are like complex numbers in 4 dimensions that solve rotation by delving into imaginary dimensions. When available in your tool, they are actually very useful. They are free from gimbal lock, and can simplify the complex handling of rotation, or even let you blend multiple rotations. If all this sounds interesting, please proceed.

クォータニオンは奇妙なものです。ツールがサポートしていれば喜んで使うし、概念的にも非常に魅力的ですが、学習目的以外では自分で実装することはあまりありません。クォータニオンは4次元の複素数のようなもので、仮想の次元に潜り込むことで回転の問題を解くような代物です。使っているツールでサポートされているなら、クォータニオンは実際にとても便利です。ジンバルロックもなく、回転の複雑な処理を単純化したり、複数の回転をブレンドしたりもできます。これらが興味をそそるようなら、先に進んでください。

History of numbers

数の歴史

This might seem like a detour, but let's take a look back at history. Humans have been expanding the concept of numbers for a long time. It probably began with natural numbers like 1, 2, 3, which naturally correspond to the number of items such as fruits or animals. The concept of zero, representing “nothing”, revolutionized the world, eventually leading to negative numbers that can represent debts or deficits. Ratios and rational numbers likely emerged from the need to measure things like weight, volume, length, etc. The discovery of irrational numbers, like the square root of 2, came as a big surprise to the Greeks, and they were afraid to reveal their findings.

遠回りに思えるかもしれませんが、歴史を振り返ってみましょう。人は長い間をかけて数の概念を広げてきました。おそらく始まりは1、2、3といった、果物や動物の数などに対応する自然数でしょう。「何もない」ことを表すゼロの概念は世界を革新し、次第に借金や赤字を表すことができる負の数も生まれました。比や有理数は、重量、容量、長さなどを測定する必要から生まれたのでしょう。ギリシャ人は2の平方根のような無理数に驚き、その発見が広まることを恐れました。

Mathematicians eventually encountered the square root of -1 in the 16th century, which led to the concept of imaginary and complex numbers. Every time new kind of numbers were discovered, they must have appeared abstract and unreal, as we can imagine from the names like 'irrational' and 'imaginary' (Though 'irrational' doesn't mean a lack of rationality, it means 'can't be expressed as a ratio'.). But these numbers have proven to be very powerful and interesting, both practically and conceptually. They are necessary for describing our world too, as in general relativity or quantum physics, and in that sense, they are quite substantial too.

やがて数学者たちは16世紀に-1の平方根を見つけ、虚数と複素数の概念を導き出します。新しい種類の数が発見されるたび、それらは抽象的で非現実的に見えたことでしょう。それは、Irrational やI maginary のような名前からも想像できます(ただし、Irrational は理性のないといった意味ではなく、比として表現できないという意味です)。しかし、これらの数は、実用的にも概念としても非常に強力で興味深いことが示されました。一般相対性理論や量子物理学のように、私たちの世界を説明するためにも必要なこれらの数は、その意味で非常に重要かつ実質的だと言えるでしょう。

Quaternions are a relatively recent addition to these different kinds of numbers in the 19th century. To understand them, it helps to start from complex numbers, a direct ancestor of quaternions.

クォータニオンは比較的新しく、19世紀にこれら様々な数の仲間に加わりました。これを理解するには、クォータニオンの直接の祖先である複素数から始めるのが良いでしょう。

Complex numbers

複素数

The square root of a number is a value that, when squared, returns the original number, such as $\sqrt{4} = 2$. The square root of a positive number can be located on the number line as another real number (Usually, there are two real numbers that can be squared to give the same real number. They are distinguished as $\sqrt{n}$ and $-\sqrt{n}$.) But the square root of a negative number cannot be placed on a number line. For instance, there isn't a real number that squares to -1. This could have been a dead end, but mathematicians did what they do, to think 'what if'. What if such a number exists? How would it behave?

数の平方根は、2乗すると元の数になる値で、例えば$\sqrt{4} = 2$のようなものです。正の数の平方根は、実数として数直線上に配置することができます(通常、2乗すると同じ数になる実数は2つあり、$\sqrt{n}$と$-\sqrt{n}$として区別されます)。しかし、負の数の平方根は数直線上に配置することはできません。例えば、2乗すると-1になる実数は存在しません。行き止まりのように思えますが、数学者たちはいつものように考えました。 もしそんな数が存在するとしたら、それはどのように振る舞うのでしょう。

The number was given a name, “imaginary number” and a symbol $i$. $i = \sqrt{-1}$, that's the definition. Since it doesn't fit on the real number line, we imagine it on a separate, perpendicular imaginary number line. This lets us place square roots of negative numbers on this new axis. For example, $\sqrt{-2}$ is $\sqrt{2}i$, and $\sqrt{-16}$ is $4i$. This extends the number system one step further, literally to a new dimension.

その数には「虚数」という名前と $i$ という記号が与えられました。$i = \sqrt{-1}$ というのが定義です。これは実数の数直線上にはおけないので、もう1つ、垂直に交わる虚数の数直線を思い浮かべます。これで、負の平方根をこの新しい軸に配置できるようになりました。例えば、$\sqrt{-2}$ は $\sqrt{2}i$ で、$\sqrt{-16}$ は $4i$ です。これで数のシステムが文字通り新たな次元に拡張されます。