Quaternions as 4x4 Matrices - Connections to Linear Algebra

Sdílet
Vložit
  • čas přidán 16. 06. 2024
  • In math, it's usually possible to view an object or concept from many different (but equivalent) angles. In this video, we will see that the quaternions may be viewed as 4x4 real-valued matrices of a special form. What is interesting here is that if you know how to multiply matrices, you already know how to do more or less any calculation with quaternions. Moreover, we will see that the fundamental relations between the quaternionic imaginary units, i, j, and k also hold in matrix form.
    If you enjoyed this video, please subscribe and leave comments!
  • Věda a technologie

Komentáře • 37

  • @feedbackex
    @feedbackex Před 7 lety +6

    Thank you so much, this is best explanation I have seen.

  • @vivekdabholkar5965
    @vivekdabholkar5965 Před 2 měsíci

    Many thanks, makes it very easy to follow without excessive effort. This is how one should be taught to retain infomation!

  • @cybernaut_ev3106
    @cybernaut_ev3106 Před 5 lety

    Very insightful. Have never seen it done like this before.

  • @SaadTaameOfficial
    @SaadTaameOfficial Před 7 lety +7

    Awesome explanation. Just a little thing that you might want to create a video to explain. There are two matrices that we can extract from a quaternion multiplication p * q. We can extract the matrix for p (which corresponds to multiplying by a quaternion on the left) and we can extract the matrix for q (which corresponds to multiplying by a quaternion on the right). Fastforward to the video where you describe 3D rotations by using quaternions: here the formula is given by q * v * conj(q). Now people who write code are often presented with a routine to convert from quaternion to rotation matrix. This can be done by extracting the matrix for q (call it A) and extracting the matrix for conj(q) (call it B) and then multiplying B by A (or A by B). The matrices commute in this case. I hope that I did not make mistakes.

    • @Math_oma
      @Math_oma  Před 7 lety

      +Saad Taame
      Could you clarify what you mean by "extracting a matrix", perhaps with a numerical example? Furthermore, what is the point of converting the quaternion to a rotation matrix?

    • @SaadTaameOfficial
      @SaadTaameOfficial Před 7 lety

      mdphdguy1 I mean representing the quaternion multiplication as a matrix-vector product. You showed the matrix corresponding to p in the video but there is another matrix corresponding to q. As for the rotation matrix, this is used in computer graphics.

    • @code-dredd
      @code-dredd Před 7 lety

      +Mathoma The point of converting a quaternion to a rotation 3x3 matrix is for computer graphics. The graphics processors (GPUs) expect matrices, so they need to be converted.
      The formula to convert a quaternion to a rotation matrix looks very different[1] from the template you described in the video. Not sure if that's something you've explained in another video. If not, perhaps a video in the near future?
      [1] en.wikipedia.org/wiki/Rotation_matrix#Quaternion

    • @Math_oma
      @Math_oma  Před 7 lety +1

      +ray
      This matrix you cite is this way because the quaternions act in a two-sided manner to do rotations, i.e. the quaternion and its conjugate act on vectors by a left- and right-multiplication, both of which are linear operators. The matrix I have in this video does a left mutiplication and there's another matrix that does right multiplication. If you compose those two matrices/ linear transformations (multiply them together) you get a 4x4 matrix that looks like the one here and if you get rid of the first row and second column you get this matrix (after some substitutions based on the assumption you're using a unit quaternion: a^2+b^2+c^2+d^2=1).
      Although this might work well in practice, thinking of quaternions as acting through a one-sided transformation, i.e. represented by that single matrix you cite is no good at the abstract level because rotations in general act through two-sided transformation laws.

  • @user-yw5yr4mk2c
    @user-yw5yr4mk2c Před 7 lety +2

    another one great video! thank u

  • @sashamuller9743
    @sashamuller9743 Před 4 lety +1

    great series!!

  • @samsunnahar9175
    @samsunnahar9175 Před měsícem

    THANKS A LOT FOR EXCELLENT VIDEO!!!

  • @mohammadhashemi4755
    @mohammadhashemi4755 Před 3 lety +4

    Some awesome explanations here! Thank you for this amazing video, really helful

  • @giobrach
    @giobrach Před 5 lety +1

    In other words, there is a ring isomorphism between the ring of quaternions and a subring of 4x4 real antisymmetric matrices. There is also a similar isomorphism between the ring of quaternions and a subring of 2x2 *complex* matrices: through it, the four quaternionic units are translated into the Pauli matrices. To see this, divide the 4x4 matrices corresponding to the units into 2x2 blocks and "reverse" the usual isomorphism between complex numbers and 2x2 real antisymmetric matrices with identical elements on the diagonal ("2D rotation matrices")

  • @LowtechLLC
    @LowtechLLC Před 5 lety

    Omg that is so helpful

  • @brucemoore2944
    @brucemoore2944 Před 5 lety +2

    Great Videos. Question for you though. When you represented a quaternion as a 4x4 matrix in the beginning of this video, why did represent only one of the quaternions as a 4x4, the other as a 4x1, and not both matrices as 4x4's?
    Thank You in advanced for you response
    bruceam

    • @samtree99
      @samtree99 Před 5 lety +1

      Bruce Moore You can write two 4x4 and do the normal calculation, it will give you a 4x4 as a result matrix. On that result, you only care about the first column which is the new a,b,c,d. He was doing a simplified version by only calculate one column. He did mention it in the video. Pretty smart guy.

  • @5-sf
    @5-sf Před 9 měsíci

    S tier video

  • @mauricepanero
    @mauricepanero Před 6 lety +2

    Spinors?

  • @FloppyDobbys
    @FloppyDobbys Před 5 lety +1

    YES!!

  • @lohdiwei9778
    @lohdiwei9778 Před 4 lety +1

    Certainly the most tiresome array of ones and zeroes and minuses that I have ever -- with a wee bit of admiration -- awarded a thumbs-up to!
    👌😊

  • @david_porthouse
    @david_porthouse Před rokem

    On the dodgy computer that I use, the CPU adds on small random errors whenever it does a multiplication. This will be disastrous if the graphics system uses vectors and t-matrices to do a chain of rotations. However with quaternions we can continually renormalise newly-generated quaternions so it isn’t so bad. If you replace quaternions with 4x4 matrices, well yes you can do it, but you are throwing away a principal merit of quaternions.

  • @jimnewton4534
    @jimnewton4534 Před 6 lety +2

    If a matrix times a matrix equal the matrix times a vector, then I think of eigenvalues and eigenvectors. What's the relation of quaternions to eigenvectors?

    • @paulwolf3302
      @paulwolf3302 Před 2 lety

      That's a good question. Using my guessing ability, I would guess that eigenvector must have a length equal to the scalar value in the quaternion. Normally it is the square root of the sum of the squares of the basis vectors xyz, but quaternions have a separate scalar value, unrelated to the position in vector space.

  • @pladselsker8340
    @pladselsker8340 Před 3 lety

    thanks

  • @paulwolf3302
    @paulwolf3302 Před 2 lety

    This is probably right, but I get confused mixing vectors and scalars in the same matrix. The simplest example of a quaternion in real life that I can think of would be a 3-D temperature map. At each position xyz in space, you have a scalar value for temperature. The temperature can't be derived from the position - it's just a measurement of the real temperatures, let's say in your living room.
    Now imagine quaternion #2, which is a humidity map of the same room. You're going to add or multiply them, combine them in some way because the heat and humidity, put together, are uncomfortable and you want to find a better spot for the sofa. My intuition tells me that you would combine the scalar parts (add, multiply, whatever) at each point in the same 3-D vector space (the dimensions of the room).
    I'm not sure how accurate this is, but it's the mental image I have of quaternions. I am not sure why the vector part changes when two quaternions are combined. Sorry if this is an impossible sounding question, but that's where I am in understanding this.

    • @frankw5471
      @frankw5471 Před 2 lety

      For your application, you probably don’t need to use multiplication of two quaternions. You just look at each position one by one, figure out how to come up with an index for level of uncomfort. I believe another important application would make sense: 3D rotation about a vector, two in a row for example.

  • @stephenmorais8696
    @stephenmorais8696 Před 8 měsíci

    Is there a way to do qvq-1 using matrices?

  • @SandburgNounouRs
    @SandburgNounouRs Před 7 lety

    How can you multiply a (1,4) matrix (vector) by another (1,4) matrix and have for result a vector (1,4), the dimensions are incompatible, right ?

    • @Math_oma
      @Math_oma  Před 7 lety +4

      +SandburgNounouRs
      Remember we're converting the quaternion on the right to a column vector which is a 4 x 1 matrix (4 rows and 1 column). That's being multiplied on the left by a 4 x 4 matrix (the representation for the left quaternion) so the dimensions are compatible for matrix multiplication.
      Alternatively, I could have converted both left and right quaternions to their 4 x 4 matrix representation and multiplied those but using a column vector. That's actually what I'm thinking of when I say the quaternions can be thought of as a special subset of 4 x 4 matrices over the reals (this subset also forms a _ring_ ) of the form given in the video. The whole business of thinking of the one on the right as a column vector is a computational trick just because I didn't feel like multiplying out the whole 4 x 4 matrix, which is redundant anyway, and gives you the same quaternion in the end.

    • @PerthScienceClinic
      @PerthScienceClinic Před 3 lety

      In effect, instead of multiplying two matrices, we're applying one to the other.

  • @DrDeuteron
    @DrDeuteron Před 2 lety

    SO(4)

  • @gideonbuckwalter4128
    @gideonbuckwalter4128 Před 7 lety +3

    Cool, so 1, i, j, and k are their own inverses!

    • @Math_oma
      @Math_oma  Před 7 lety +3

      +Gideon Buckwalter
      Well, the identity matrix is equal to its inverse but for the i,j,k matrices, remember that these three matrices will square to -1. That implies that the inverse is actually the negative of these i,j,k matrices. This also happens to be the conjugate, just like in the complex numbers.

    • @gideonbuckwalter4128
      @gideonbuckwalter4128 Před 7 lety +1

      Oh right! So the conjugate of 1, i, j, and k are 1, -i, -j, and -k which means the conjugate of any of these is their matrix inverse. Is that right?

    • @Math_oma
      @Math_oma  Před 7 lety +3

      +Gideon Buckwalter
      Yes, the quaternion conjugate works just like complex numbers - you just negate all the imaginary parts and keep the real part the same. Furthermore, if you examine the matrix representation, taking the matrix transpose gives the representation for the conjugate.
      Another reason for the inverse being equal to the conjugate is that the conjugate is set up so that q.q*=|q|^2 where |q| is the magnitude of the quaternion (same deal in the complex numbers). All those quaternions, 1,i,j,k all have a magnitude of 1 so that means q.q*=1 which means q^(-1)=q*.