3

I'm trying to establish conversion between coordinate frames of reference of a phone camera and onboard gyroscope. Because some phones flip Y axis of video, I do not want to limit solution to RHS<->RHS case.

Is there a quaternion way to encode a matrix with negative determinant, e.g. negative identity matrix?

Tosha
  • 133
  • Is RHS "right handed coordinate system"? – rschwieb May 24 '16 at 18:14
  • Yes, that's what I meant. The reason I asked was because there seems to be a mismatch in the number of combinations of matrices from R3x3 which solve my case (24 with positive det and 24 with negative), yet I found (although by trial and error) only 24 unit quaternions which permute/negate axes: 4 with three zeros and one, 8 with +/-0.5 in all places, and 12 with +/-sqrt(3)/2 in 2 places and zeros in other. – Tosha May 25 '16 at 12:06

1 Answers1

3

If $n$ is a quaternion with real part zero such that $n^2=1$, then $q\mapsto -nqn$ achieves a reflection in the plane normal to $n$. (This maps $\mathbb H\to \mathbb H$, but you are mainly interested in the fact that it maps the pure quaternions into the pure quaternions, since that's your model of $3$-space.)

You can use this to transform between right and left handed coordinate systems.

rschwieb
  • 153,510
  • First, thank you for quick response! Yet please clarify a couple moments to me, (1) is 'x' quaternion multiplication in your answer? And (2), isn't negating quaternion giving the same one (rotated by 2*pi, which is essentially the same) ? – Tosha May 25 '16 at 12:01
  • @Tosha Oh, sorry yes, there was a typo which I've now corrected. That $x$ should be a $q$, and yes, it was supposed to be a quaternion. As for your section question: yes, $rqr^{-1}=(-r)q(-r)^{-1}$, meaning that a quaternion $r$ and its negation produce the same rotation. However, that is not what we're doing here: we're not doing $nqn^{-1}$, we're doing $(-n)qn$, and this is not a rotation. It's true, though, that you can replace $n$ with $-n$ and get the same reflection! – rschwieb May 25 '16 at 14:04