Thursday, February 27, 2025
spot_img

rotation – convert a quaternion representing to a different coordinate system the place y and z are inverted?


I’ve quaternion representing a digicam pose in a coordinate house known as “World Body 2”:

  • x+ = proper
  • y+ = up
  • z+ = out

…and I wish to convert it to a different house known as “World Body 1”:

  • x+ = proper
  • y+ = down
  • z+ = in

(So, y and z are every inverted)

How can I do that conversion?

In one other thread, I reasoned it ought to work like so: (Name this “Strategy 1”)

When altering the digicam coordinate system, we alter the transformation of a 3D level from the world body to the digicam body.
The unique transformation from the world to the unique digicam is:

$$P_{oc} = R cdot P w + T$$

The transformation from the unique digicam to Habitat’s digicam is:

$$P_{hc} = start{bmatrix} 1&0& 0
0& −1& 0
0 &0& −1 finish{bmatrix} P_{oc} = R_x ( pi) P_{o c} $$

By combining the above transformations, the interpretation $( t_x, t_y, t_z )$ will change to $( t_x, − t_y, − t_z )$, the rotation R will change to $R_x ( 180 ° ) R$, and in quaternion type: $ i cdot ( w + x i + y j + z ok ) = − x + w i − z j + y ok $. Right here, i represents a 180-degree rotation across the x-axis.

One other person proposed this: (“Strategy 2”)

I agree that it is a 180-degree rotation across the x-axis. So the angle axis is:

$$
(textual content{angle, axis}) = (start{pmatrix}
1
0
0
finish{pmatrix}, pi)
$$

If we convert it to quaternion, it needs to be

$$
q = start{pmatrix}
cos(pi / 2)
sin(pi / 2)
cos(pi / 2)
cos(pi / 2)
finish{pmatrix}
= start{pmatrix}0 1 0 0end{pmatrix}
$$

So the end result will likely be $$q p q^{-1} = [0 1 0 0] [w x y z] [0 1 0 0]^{-1} = [w x -y -z]$$

I requested one other person and they linked to this thread (“Strategy 3”), which says the ensuing quaternion needs to be:

$$q = w + ix – jy – kw$$

Which one is appropriate, and why are the others incorrect?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles