# Quaternions – If they can’t see you, they can’t eat you

I did not know quaternions can manage the art of camouflage – until today. Camouflage and metamorphosis, they come together. People are wearing masks, to disguise, to cheat, to the extent that they cheat themselves. Quaternions took me by surprise. As a kid I was told about metamorphosis.

I never witnessed it myself. Until, as I said, today, until I looked at these two pictures:

In theory, if I am not making errors here, both images are supposed to represent the same story, except that it is being told by two different witnesses. It looks like a butterfly turning into caterpillar. How can it be? It is, after all, precise mathematics, not a psychology.
The first image represents the path in the group that we have discussed before in Introducing geodesics. Then, in Standing on the shoulders of giants – Reboot, examining the image obtained using my old code based on the paper of Van Zon and Schofield, I realized that:

We have a nice curly trajectory, but there are also strange straight line spikes. On animation they are, perhaps, harmless. But if something like this happens with the software controlling the flight of airplanes, space rockets or satellites – people may die. There is a BUG in the algorithm.

Bugs are no good. As I have written it elsewhere:

I believe that the Universe has Purpose, that it is much like a computer program of great complexity, and that “we” – the IGUS-es – have a role in its evolution. For a while our role can be described simply as “debugging units.” In short, my present answer to the question “why are we here?” reads: DEBUGGING THE UNIVERSE.

With the somewhat less ambitious task of removing the zigzag bug from the spinning quaternion history we decided to follow the giants and we have ended in the new algorithm based on the paper and the code by Celledoni and Zanna, the code described in The final answer for the Universe in which m<1. I will repeat this code here, with a small change that makes it more universal, as discussed in Attitude matrix for m<1.

The case
The solution of the Euler’s equations has two trajectories. For one with we take

(1)

while for the other one, with we take

(2)

Let

(3)

The solution of the Euler’s equations is given by

(4)

With constants and defined as

(5)

(6)

we set the phase variable as

(7)

where the Jacobi function is defined as
Then the quaternionic attitude solution is given by with

(8)

Why is this better than the previous formulas that were producing BUGS? The secret is in the denominator!

In the formulas for and we have in the denominator. That is The constant
is given by

The smallest possible value of is then . The largest possible value of while is when Then, with

Therefore therefore (Remember that is a cosinus of the amplitude!). So, we never have a problem with the denominator! That is the advantage of the new algorithm! No infinities, all is finite, what a relieve!

So, we take our flagship example with we choose just a little bit over the minimal value of and we draw the stereographic projection of from to
What we get is the second image.
No resemblance whatsoever to the first one.
And yet, they are supposed to represent the same reality! How can it be possible? They are like day and night …

So, I created the METAMORPHOSIS – a continuous group translation.

There is still something strange there…. And it needs to understood. Life is exciting.

## 8 thoughts on “Quaternions – If they can’t see you, they can’t eat you”

1. Bjab says:

is . Then , . …”

equals when is (not ), isn’t it?

2. Bjab says:

I’m lost.
I know that if than
but
I don’t know what is when .

3. Bjab says:

Ark,
correct me if I am wrong:

In the case of pendulum applied to high energies.
In the case of non-symmetric top applies to low energies.