Quaternions as 4x4 Matrices - Connections to Linear Algebra

  Рет қаралды 50,418

Mathoma

Mathoma

Күн бұрын

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!

Пікірлер: 36
@vivekdabholkar5965
@vivekdabholkar5965 Ай бұрын
Many thanks, makes it very easy to follow without excessive effort. This is how one should be taught to retain infomation!
@feedbackex
@feedbackex 7 жыл бұрын
Thank you so much, this is best explanation I have seen.
@cybernaut_ev3106
@cybernaut_ev3106 5 жыл бұрын
Very insightful. Have never seen it done like this before.
@user-yw5yr4mk2c
@user-yw5yr4mk2c 7 жыл бұрын
another one great video! thank u
@SaadTaameOfficial
@SaadTaameOfficial 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 7 жыл бұрын
+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 7 жыл бұрын
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 7 жыл бұрын
+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 7 жыл бұрын
+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.
@sashamuller9743
@sashamuller9743 4 жыл бұрын
great series!!
@mohammadhashemi4755
@mohammadhashemi4755 3 жыл бұрын
Some awesome explanations here! Thank you for this amazing video, really helful
@giobrach
@giobrach 5 жыл бұрын
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")
@eddiecurrent7721
@eddiecurrent7721 4 жыл бұрын
Yes Einstein!
@brucemoore2944
@brucemoore2944 5 жыл бұрын
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 4 жыл бұрын
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.
@LowtechLLC
@LowtechLLC 5 жыл бұрын
Omg that is so helpful
@5-sf
@5-sf 8 ай бұрын
S tier video
@stephenmorais8696
@stephenmorais8696 7 ай бұрын
Is there a way to do qvq-1 using matrices?
@mauricepanero
@mauricepanero 6 жыл бұрын
Spinors?
@david_porthouse
@david_porthouse Жыл бұрын
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 6 жыл бұрын
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 2 жыл бұрын
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.
@paulwolf3302
@paulwolf3302 2 жыл бұрын
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 2 жыл бұрын
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.
@lohdiwei9778
@lohdiwei9778 4 жыл бұрын
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! 👌😊
@SandburgNounouRs
@SandburgNounouRs 7 жыл бұрын
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 7 жыл бұрын
+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 3 жыл бұрын
In effect, instead of multiplying two matrices, we're applying one to the other.
@pladselsker8340
@pladselsker8340 3 жыл бұрын
thanks
@FloppyDobbys
@FloppyDobbys 5 жыл бұрын
YES!!
@FloppyDobbys
@FloppyDobbys 5 жыл бұрын
Valuable insights
@DrDeuteron
@DrDeuteron 2 жыл бұрын
SO(4)
@gideonbuckwalter4128
@gideonbuckwalter4128 7 жыл бұрын
Cool, so 1, i, j, and k are their own inverses!
@Math_oma
@Math_oma 7 жыл бұрын
+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 7 жыл бұрын
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 7 жыл бұрын
+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*.
Quaternions EXPLAINED Briefly
17:51
Mathoma
Рет қаралды 299 М.
Quaternions: Extracting the Dot and Cross Products
18:49
Mathoma
Рет қаралды 25 М.
😱СНЯЛ СУПЕР КОТА НА КАМЕРУ⁉
00:37
OMG DEN
Рет қаралды 1,8 МЛН
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Рет қаралды 120 МЛН
0% Respect Moments 😥
00:27
LE FOOT EN VIDÉO
Рет қаралды 46 МЛН
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 29 МЛН
a quaternion version of Euler's formula
20:33
Michael Penn
Рет қаралды 71 М.
Complex Numbers as Matrices
16:25
Mathoma
Рет қаралды 63 М.
Perspective Projection Matrix (Math for Game Developers)
29:13
|i Factorial| You Won't Believe The Outcome
8:24
BriTheMathGuy
Рет қаралды 316 М.
SLERP (Quaternions)
22:02
EgoMoose
Рет қаралды 52 М.
Fantastic Quaternions - Numberphile
12:25
Numberphile
Рет қаралды 1 МЛН
Quaternions
39:07
UC Davis Academics
Рет қаралды 168 М.
Euler vs Quaternion - What's the difference?
8:49
Class Outside
Рет қаралды 29 М.
Что еще за обходная зарядка?
0:30
Не шарю!
Рет қаралды 2 МЛН
Купите ЭТОТ БЮДЖЕТНИК вместо флагманов от Samsung, Xiaomi и Apple!
13:03
Thebox - о технике и гаджетах
Рет қаралды 59 М.
Apple Event - May 7
38:22
Apple
Рет қаралды 6 МЛН
Самая важная функция в телефоне?
0:27
Опросный
Рет қаралды 215 М.