obviously they produce rotation because they're called qua-TURN-ions duh
@ARBB14 жыл бұрын
lol
@sagatparkes3 жыл бұрын
bravo, top comment
@cosmicAK2 жыл бұрын
Crazzzyyyyt
@ytcommentsguy2 жыл бұрын
this comment is gold
@joshl.8950 Жыл бұрын
I thought it was because you could use them to model an 🧅
@swift45932 жыл бұрын
I love this explanation! I watched 3blue1brown’s video first, but I still had a lot of questions. This video cleared most of those questions for me
@TheRojo387 Жыл бұрын
Assume the result and the initial vector are unit vectors; q encodes angle by a real part much like a dot product = the cosine of half the angle between them, and that AND axis by quaternion parts basically a cross product with a magnitude of the sine of half the angle between them. This makes quaternions very powerful for 3D rotations.
@fcolecumberri10 ай бұрын
3blue1brown's video was quite confusing (and I already knew about them), this was much more easier to understand.
@jamesking24392 жыл бұрын
I finally understand why the double rotation happens and why you need the two sided multiplication to fix it. Thank you for this explanation!
@PrayAlways-mn7wh6 ай бұрын
Great job and this is by far the best description of a quaternion video I have come across. One comment I have is that "by definition" contains no information why things are the way they, there is no insight or intuitive feel for the description of "the way things are the way they are". "By definition" often is stated by the teacher to the student, to mean do not ask any more questions rather than giving insight. "By definition" should be explained in context, and often it means "logically consistent" or it leads to an "illogically consistent" result, in both cases the "logically consistent" and "illogically consistent" result should be explained. For quaternions, the "by definition" implies a logically consistent subfield of numbers given all pertinent rules are stated and followed. This is why Rowan Hamilton was excited and immediately scratched down the formula i^2=j^2=k^2=i*j*k=-1, he had in essence discovered a new field (to be more accurate a new subfield) of numbers, a new space, which is logically consistent given the stated quaternion rules of multiplication. The focus shouldn't be on "by definition" but the fact that Rowan Hamilton had discovered a new subfield of numbers which was only appreciated once computers and computer games became popular. To see the illogical consistency, one can attempt to create a field or subfield with i and j only, if you attempt to do this you will quickly find there is illogical consistencies within a 3-dimensional world, and one has to go to 4 dimensions (quaternions) with some extra multiplication rules to make a consistent subfield.
@hotbit7327Ай бұрын
Math is often reformulated into better structures but sometimes becomes more difficult to understand. I saw Hamilton's paper, and it's one of the best places to start with quaternions, maybe the best. First, when he tried to extend complex numbers, he came out with a + bi +cj - note, no k! But when trying to multiply... what the heck is ij? So let's temporarily name their product as k. From there he deduced i^2=j^2=k^2=i*j*k=-1. Thus it was a long intellectual process to get to quaternions. Unlike modern papers, I like this old fashion papers more, as they sometimes show The Process of thinking, the train of thoughts of the discoverer.
@PrayAlways-mn7whАй бұрын
@@hotbit7327 The process of discovery is difficult for the first trailblazer since no path exists. To go from real numbers to complex numbers, which Hamilton was a part of, spans from 780 Al-Khwarizmi in linear Algebra solutions to Augustin-Louis Cauchy 1814 complex function theory in an 1814 memoir. William Rowan Hamilton, 1843, was on the post acceptance of complex numbers. It is natural from a linear algebra point of view, btw Hamilton approached the argument by linear algebra and not by spatial geometry argument, to consider a + bi +cj and as you noted there is no k. When you do 3 dimensional complex number multiplication you are left with answering, what is i*j, and it is this question that every morning Hamiton's son was indirectly asking when he asked Hamilton, his father, ""Well, Papa, can you multiply triples?" Eventually this quandary to Hamilon led him to say i*j=k, this was the breakthru moment which led him to scrape on the Dublin Bridge i*j*k=-1. The formula i*j*k=-1 is a consequence of saying/understanding/inventing/utilizing i*j=k, eureka moment, the actual breakthrough was having the insight or courage to try, to understand that i*j=k. The fact that Hamilton expressed Quaternions as Q = w + ix + jy + kz in his classic paper on Quaternions, tells you he understood that the solution of "multiplying triples" was really operating in 4D space and not 3D. 3D multiplying is logically inconsistent, one has to go to an even order dimension for there to be consistent and logical linear algebra multiplications, given special but simple algebraic rules exist. The history of great leaps is strewn with the realization that one lives in the same world before and after the realization, however one sees the world entirely different.
@oystercatcher9433 жыл бұрын
This is by far the BEST description I’ve seen of quarternions brilliantly explaining both the maths and practical side of 3D rotations!
@justvinchy87763 жыл бұрын
Wow! I didn't imagine someone could explain is as good as you did. Great job.
@felipeceler4 жыл бұрын
Best explanation so far. Thank you for sharing it !
@maxwellchiu99342 жыл бұрын
Been looking at quaternions for a year . This is the best source so far. Much appeciated.
@noahblaine1901 Жыл бұрын
I am not sure who this is for. This explanation was quick and dirty and assume a very good understanding of math lingo.
@hermit1428 Жыл бұрын
if you have some basic knowledge about 3D vector and Euler's formula, you should understand most of the video
@goli2920093 жыл бұрын
I loved the video. Hamilton is one of my favorite mathematicians and I really love to talk about him. Quaternions are one of the mathematical concepts invented long time ago which have been used recently. One of the infinite many examples that answers the question "where I will be using this stuff" in math classes. Now, I can give a more clear description about how quaternions are used in animations. Thanks a lot. I sincerely appropriate it.
@Danielle-ew1elАй бұрын
thanks for keeping the quality so high across all your videos!
@darkexior4 жыл бұрын
Best video explaining quaternion rotation
@benjaminreynolds57333 жыл бұрын
I just found this channel and I am so happy that I did. Can’t wait to see more videos to come from this channel and hope it will be recognized by the rest of the mathematics community on KZbin.
@stevewhitt91092 ай бұрын
I have watched a lot of vids and wiki on Quaternions, but now finally I understand them. Thanks.
@Tantandev4 жыл бұрын
The animations are next level!
@user-fr9py6fe6q8 ай бұрын
By far the BEST description after wandering all the materials.. Thanks !!
@billpengelly7048 Жыл бұрын
Weird how it’s almost like the algorithm can read my mind. I’ve been thinking about rotation and higher dimensional space. And then I get recommended a video about quaternions and rotation. 😮
@0x90meansnop8 Жыл бұрын
Bro, I watched a lot of stuff online for quaternions, but really nobody - and I mean nobody I've encountered - ever explain how to actually rotate things with that. Yeah sure, there are some good explanations what quaternions really are and stuff like that, but not a single example on how to do it. Up until this moment I thought quaternionrotation happens only by multiplying a pure quaternion by a rotation quaternion and wondered why my results are so dumb. You made it click for me and I want to thank you a lot for that. Or how a german would say it: "Der Groschen ist gefallen." Have a nice day.
@movingheadmau81283 жыл бұрын
That was an amazing explanation, thank you for sharing! :) The last part is what flashed me the most. I use quaternions for animation and rotation handling in Unity-Engine and I thought that a quaternion would only be non unique when using a rotation angle which is theta + k*360° where the sin and cos would yield the same results. I had never thought or heard of the fact that there is in fact a way to encode the "long" and the "short" way from one rotation towards another. My assumption was that quaternions would just always yield the shortest rotation. :D
@pavelperina7629 Жыл бұрын
This is pretty good. My best understanding so far was somewhat halfway between geometry algebra rotors and quaternions. Like let's rename vector space to i,j,k or e1, e2, e3. Now let's define piecewise multiplication which says that vectors i,j,k are multiplied by right-hand rule (i*j=k), but when they are multiplied by themselves, they become -1. Now use that sandwich multiplication that rotates vector by angle and adds scalar to it and then rotates it again and removes that scalar. In simple cases rotation is halfway and scalar is not produced. By the way quaternion interpolation is NOT so easy as advertised. It's same like with complex numbers: multiplying by complex number gives you rotation. Oh, by the way ... if that complex number is on unit circle, otherwise it scales everything too. If you interpolate between two numbers on unit circle/sphere, you get closer to center and they downscale everything. Obvious solution is to normalize interpolated complex number. Hell, we have two problems now - how to normalize it when it passes through zero (interpolating rotation by 180 degrees gives us singularity just like Euler angles) and second problem is that as it gets closer to zero, angular speed increases. In the end, solution to interpolation between two orientations is to use two quaternions to find axis and angle and to interpolate that angle (SLERP - spherical linear interpolation). Then it's questionable if we want to construct quaternion or matrix, because multiplying thousands of vector by a matrix is cheaper operation. But there are some nice uses for quaternions, such as storing orientation efficiently, finding vector and angle between two, generating random orientation, likely more complex smooth interpolation without sudden changes of angular velocity at control points.
@NXTangl Жыл бұрын
You could always precompute the matrix from the quaternion by applying the transformation to each basis vector...
@3zdayz3 жыл бұрын
I'm not sure that it matters if you can understand how quaternions 'work' themselves. They are just a math representation of axis and angle, matrices can also be computed from just axis and angle. Turns out if you don't split axis and angle you get (angleZ,angleY,angleZ) which is just a 3D thing. Rotations are 3 dimensional, even though Quaternions have 4 independent parts, to actually represent rotations they have constraints on their possible values. Consider you can represent velocity as speed*direction, angular velocity is angle * direction (angle * axis). And it turns out that vectors in the 3d rotation space have a direction that is the same as the rotation axis and their length determines how much rotation is applied around that axis. ... but maybe that's too abstract, rotations are represented with a gyroscope always. The axis of the gyroscope is the axis of rotation, and the angular offset of the rotor is the angle around that axis. All rotation formulas went back to angle and axis, and after some persistence, I now have actually just angle-angle-angle rotations github.com/d3x0r/STFRPhysics , which is just the basic 3 dimensions for rotation. If I took and separated everything into speed*direction instead of velocity, basic motion in 3d space would also appear as a 4d vector.... but really it's just a 4d projection of the basic 3d system. kzbin.info/www/bejne/Zoqal6CDqdGgabM Quaternions actually fail - (1) you can't recover from the cos(theta/2) the actual rotation angle, but only +/- pi.... also near 0, the sin(theta) * axis you lose the actual axis components of rotation - same at 180 (well, 360 since it's theta/2) ...
@JasonCunliffe3 жыл бұрын
wow = Really intreresting reply. Thanks!
@MGTOW-nn9ls2 жыл бұрын
This video is outstanding. The best explanation of this tricky material. Sir, you are low profile genius. Thank you,
@paralol_7 ай бұрын
This was super clear and super fun! It really helped me understand it better, thanks a lot!
@kartikeyadubey921111 ай бұрын
Thank you for making this!!! I just learnt about quaternion rotations in class and unfortunately my prof couldn't go into great details (time constraints) about how the rotations are produced.
@indepen Жыл бұрын
You save me a lot! I just struggle to quaternion but can't understand. thank you so much and thank penguin!
@mitrafathianpour19872 жыл бұрын
Thank you so much.. it was useful for me because my thesis is related to this subject and I am really interested in Quaternions because it has special role in our life.
@coolfungirl82772 жыл бұрын
me too. specifically quaternion phi spiral.
@ingiford1752 жыл бұрын
The why asked around 3:50ish is because it is defined that way, and that definition satisfies that the definition forms a Group, which gives it many properties we can use since it is a group.
@inrr23182 жыл бұрын
I've had trouble understanding it but your video help me a lot . Great work , thank you
@AndyOpaleckych2 жыл бұрын
This video is awesome. Very nice explanation and funny jokes. When penguin pulled out the second pair of 3D glasses I audibly laughed. Thank you :) PS: I'm just a little disappointed about the flip joke... I hoped he would unfold like the hypersphere in 3B1B video and fold back in. That would be a true 4D flip
@alexmassy11 ай бұрын
Pure concentration of mindblowing explanation ! Thx
@jerthАй бұрын
It would be soooooo awesome if you did a video on Rotors and how they differ from Quaternions
@marcobrini2 жыл бұрын
Extremely well explained! Bravo.
@_general_error9 ай бұрын
I can see now, that quaternion operations remind me on how charges move in the electromagnetic field. A "moving" charge will produce a circular magnetic field (It's "charge under acceleration produces a circular magnetic field with it's plane oriented perpendicular to the direction of acceleration)...
@RegorForgot3 жыл бұрын
you need more subs! this was hilarious and informative!
@hyunjoebrother2 жыл бұрын
Hey I just watch this video by our University's Professor's Computer Graphics Lecture Penguin Voice is VERY Awesome lol
@tw5718 Жыл бұрын
Very nice. This had all the info I was looking for.
@Meanderingthinker3 жыл бұрын
great video, I've been trying to learn quaternions and get my head around it for a while, your video really helped
@silverlining68243 жыл бұрын
All lectures on quarternions are given by mathematicians, via complex numbers. Maybe the following practical application will motivate the need. Rotations in 3D can be expressed in terms of two angles, theta and phi. One of them lies in the plane formed by two of the orthogonal axes, say X and Y; and the other in the plane involving the third axis, say X and Z. Any 3D rotation can be expressed as sine and cosine of theta and phi. So, what is the problem? Why are the quarternions useful? Trigonometric functions such as sine are computed as infinite series. (Look up Taylor Expansion for the Sine and Cosine functions). Exact solution involves infinitely many terms. Bit real time gaming demands fast computation. Yet, truncation of a series as approximation necessarily involves errors. So what is one to do? This is where quarternions come in; they involve only dot and cross products of real numbers - very fast and at the same time exact and precise. Now, are you motivated to follow this or any other presentation on quarternions?
@SurprisedDivingBoard-vu9rzАй бұрын
There is only one force which is fusion. But the balancing act is done by fission and electrical and magnetic and gravity. 4 though 3. Every force is an accelerated frame of reference. Dark matter and dark force is a special frame of reference. Usually hidden casts. Dark matter can sometimes be seen as white matter or normal matter when you almost reach the speed of light. Like when electrons are accelerated to almost speed of light they see nucleus as huge hurdles.
@kongolandwalker Жыл бұрын
Much better for a noob than 3b1b spheres, but i still don't understand fully. Some parts of the explanation felt like jumps, in the second part of the video.
@miinyoo2 жыл бұрын
Simply adorable.
@yolotaylor9937 ай бұрын
so interesting viedo, vivid and explicit
@randysonnicksen94753 жыл бұрын
I had to watch this many times but I finally get the whole qvq-1 idea and why we use half the rotation angle. Still mind bending but this helped tremendously. But now I'm struggling to understand how to use this to track my aircrafts orientation. In this video he rotates a vector v using q and q-1. But how do I express a bodies orientation initially with a quaternion that includes all the information (yaw, pitch, roll) of the aircraft. The vector ijk components in v only represent yaw and pitch, but not how the body is rolled. If I start with v = 1,0i,0j,0k which is the quaternion orientation corresponding to yaw, pitch, roll = 0,0,0 then when I left multiply by the rotation matrix q and right multiply by q* or q^-1 the orientation doesn't change. When I only left multiply by q, the orientation seems to move correctly for small angles (pitch and roll < 90 deg)
@jamesking24392 жыл бұрын
The qvq* formula is only for applying rotations to vectors of the form xi + yj + zk. To apply one rotation to a other rotation, you just use q2 * q1.
@angeldude1012 жыл бұрын
A rotation doesn't care which direction it's facing as long as it stays within the same plane. If you try to rotate a rotation, then trying to apply the rotation would just snap it back to whatever you're rotating. Composing rotations is distinct from rotating the rotation.
@mueezadam84383 жыл бұрын
7:05 made me giggle
@boerdler3 жыл бұрын
me 2 xD
@keypo790 Жыл бұрын
3:53 discovery of that formula ijk = -1 is discovered how, is shown by Jeff Suzuki youtube channel titled " Hamilton and the Quaternions"
@smizmar82 жыл бұрын
"...basically pulled them out of a hat" ..love it 😂
@tobuslieven2 жыл бұрын
The multiplication rules exist because we're saying, "If there was a system that obeyed these rules, what would its behaviours be?" Then we find out those behaviours are really useful.
@npathegenius57333 жыл бұрын
I am amazed at how clearly you pointed out the little details of the multiplications and rotations, I learned quite a bit usage wise. Absolutely well done. Do you have a discord account? I would love to talk to you about quaternions and other mathematics sometime!
@AbrahamGarcia-bo3rk4 ай бұрын
This is not what really happens, in reality the rotation (in any dimension) is the result of perform two consecutive reflections, in this way the angle of rotation is twice theta. and actually in any form of mathematics where you can represent points and reflections you can also represent rotations, for example with complex numbers, matrices, quaternions, etc. Sorry for my bad english
@huajinmsl2 жыл бұрын
this is the best explaination for quaternions👍
@angeldude1012 жыл бұрын
Something interesting happens when you rename the unit quanternions a little bit: xy, yz, and xz. But if those were just formed by normal multiplication, then it looks almost like it could've been the cross-product, which is antisymmetric and would suggest that yx, zy, and zx also exist and are the negatives of the first three. So xy^2 = xyxy = -xxyy = -1... huh. and xyyz = xz... hmm... Perhaps the quaternion products are more fundamental than you claim here when you suggest that they were just defined this way. (I did gloss over xx = 1 etc. There's a lot more going on here that is _really_ interesting. Among other things, it _does_ become obvious that these become a rotation considering xy can be read as the rotation the brings x to y.)
@2fifty53311 ай бұрын
3:41 well actually, there _is_ a reason why these rules are true, and you can find this when you replace quaternions with rotors quaternions are basically obfuscated rotors, and with rotors you can derive stuff a lot more naturally
@maxwellchiu99342 жыл бұрын
Watched this video many times. Only thing I can't figure out is why Cos and Sine are designated on non-traditional axis (see 8:20). If anybody is still monitoring these comments, I would love an explanation. I would have flipped Cos and Sine. Otherwise, best explanation out there!!!
@maxwellchiu99342 жыл бұрын
Never mind. I just figured it out. It says so in video that unit vector just needs to be orthogonal.
@fidhalkotta2 жыл бұрын
Fantastic video
@windowsxseven2 жыл бұрын
swear to god every time the penguin comes up i can't help but ball my fist
@PenguinMaths2 жыл бұрын
haters gonna hate lol
@tedsheridan8725 Жыл бұрын
Cool video. But your diagrams at 10:18 on aren't making sense to me. Are the pi's supposed to be radian values of the rotator in quaternion space? or the actual values of the physical rotation? Either way, they don't correspond to the rotation of the igloo in either direction.
@markmisin3 жыл бұрын
An amazing explanation!
@gmendozafiee3 жыл бұрын
i still dont understant, why you said "same two circle" on 4:09min, i only see one circle and one line, why 2 circle?
@hush_dxl3 жыл бұрын
the second circle is the line itself: the first circle is in the ijk space, the second one is related with the *real* axis. watch 7:19 for reference
@keypo790 Жыл бұрын
4:50 rotation should be counter-clockwise when talking about right-multiple of (-i)
@zhaobryan44412 ай бұрын
this is the best one
@TRIC4pitator16 күн бұрын
wait i get it, that's so fucking cool
@N7Tonik2 жыл бұрын
I think the circle at 4:50 should point to the opposite direction like from j --> k and not k --> j
@OmarAGarciaA3 ай бұрын
I think the circle (jk) at second 4:50 is mistakenly drawn. The arrows should poiont the other way around
@indranildas9565 Жыл бұрын
This was soooo good. Thanks
@krei-se2 жыл бұрын
Thanks for the great video! I really missed a clear math background on this in the interactive videos and wikipedia is not nearly as clear as your descriptions!
@harjoat2 жыл бұрын
thanks king
@festa19992 ай бұрын
Anyone know if there is a resource somewhere that solves out the qvq* quaternion multiplication step by step to derive the simplified form that you usually see on the internet? A lot of the explanation I find just skip the whole thing because it's tedious
@SuperDeadparrot Жыл бұрын
When using quarternions with complex coefficients, does complex i commute with quarternion i,j,k or not?
@keypo790 Жыл бұрын
So Mr Hamilton basically invented(i dont know maybe discover a rules) quaternions that describes the rotation(
@NoNameNoShame223 ай бұрын
“If you like math” no sir, i do not but I’m out of options…
@adolforosado2 жыл бұрын
If you like Quaternions, you may want to give the video I posted a look and a comment. Not mine, Credit where it's due.
@keeravan8 күн бұрын
WHY IN COORDINATE SYSTEM CENTER IS NOT ORIGIN = (0, 0 ,0) INSTEAD IT IS 1.TIMING 10.04 SECS
@deepakbamania79452 жыл бұрын
what is right and left multiply? sorry for asking such a basic question
@PenguinMaths2 жыл бұрын
You might be used to multiplication with real numbers which are commutative, which means the answer is the same even if you change the order of the operands. eg 4 * 5 = 20 and 5 * 4 = 20. This is not true though of quaternion multiplication. If q1 and q2 are quaternions then q1*q2 is not always equal to q2*q1. In the first case we say that we left multiply by q1 and the second case we right multiply by q1. To describe this property we say that quaternion multiplication is not commutative.
@andrewfrolov5144 Жыл бұрын
How do you do that voice for penguin character? Is it a bot a real person narrating?
@Navhkrin3 жыл бұрын
I didnt know you guys had a mind reading penguin at home
@sanketvaria97343 жыл бұрын
This is hard as hell
2 жыл бұрын
Hi I would like to know from what where did you learn about the concept at 7:17. Great video btw!
@theultimatereductionist75922 жыл бұрын
For complex numbers, z, and given positive integer, n, there exist finitely many z in C such that z^n=1. But, there exist uncountably infinitely many quarternions, q, in Q, such that q^n=1. I had the paper proving this. Short proof. Essentially, Q having dimension 4 over the reals, having 2 extra free real parameters, is what gives us uncountably infinitely many solutions.
@tanchienhao3 жыл бұрын
amazing video!
@0zyris9 күн бұрын
What do you have to know first for this to make any sense at all? Feels so much like a foreign language.
@TheRojo387 Жыл бұрын
Multiplying two pure quaternions is the equivalent of deriving two vectors' dot product AND cross product in one fell swoop. Well, almost; quaternion multiplication produces the NEGATION of the vector equivalent dot product.
@mj2carlsbad3 жыл бұрын
So basically point in a direction with a 3d vector then rotate around it by theta degrees?
@ww87203 жыл бұрын
if the intended quaternion (q ) is (1,0,0,0) but I get q1=(0.328,-0.395,0.575,-0.6337) instead, how do I rotate q1 to get to q?
@ian7313 жыл бұрын
I liked the video and the penguin, bring them both if possible kk
@keeponspiral75724 жыл бұрын
nicely done helped btw
@chilinouillesdepommesdeter8193 жыл бұрын
PenguinMaths,I found your vulkan-diagrams repo recently,and those diagrams are so great,could tell me what software you use to make them?
@PenguinMaths3 жыл бұрын
Thanks! I use inkscape to make the diagrams
@Spiegelradtransformation8 ай бұрын
This is by definition. What is in mechanic ?
@masturdOfTheUniverse3 жыл бұрын
Where is -1 on the number line located? Is it at infinity?
@randysonnicksen94753 жыл бұрын
So I went through the tedious exercise of expanding out qp = (A + Bi + Cj + Dk)(a + bi + cj + dk) and then right multiplying the result with the conjugate of q (q*) which is A - Bi - Cj - Dk) and after simplifying, each of the coefficients of the imaginary vector terms are products of the initial orientation (p)'s imaginary terms b, c and d. Therefore, if the initial orientation is aligned with the reference frame (1,0,0,0) the resulting final orientation after any rotation by q (left multiply by q, then right multiply by q*) has imaginary terms which are all zero. Why doesn't rotation work for the initial orientation of 1,0,0,0??? The result of qpq* with q and p defined as above is: a(AA + BB + CC + DD) + i [ b(AA + BB - CC - DD) + 2c(BC - AD) + 2d(AD + BD)] +j [ 2b(AD+BC) + c(AA - BB + CC - DD) + 2d(CD - AB)] +k [2b(BD - AC) + 2c(AB + CD) + d(AA - BB - CC + DD)] You can see that the coefficients of the resulting imaginary terms (i, j, k) are all the result of products of the initial orientation vector coefficients (b, c and d). What am I missing here? I thought that if I started with an initial orientation aligned with my reference frame, and then performed a rotation on that orientation, I would get a result which represents the final orientation. Is this a special case (1,0,0,0) where the rotation formula doesn't work? That doesn't sound likely because it would mean the quaternion method would have it's own form of "gimbal lock". Can someone explain this??
@PenguinMaths3 жыл бұрын
Remember that v needs to be a pure quaternion, ie the real part should be 0 (6:26). Because we are only rotating a 3D vector which we specify as the vector part of v (what you have named p). Since you have specified the whole vector part of p as the zero vector, after rotation it remains the zero vector which is what you noticed by observing 'a' doesn't show up in the expressions for the coefficients of i, j, or k. Also good for you for working this out, this is how you learn!
@randysonnicksen94753 жыл бұрын
@@PenguinMaths Thanks for the reply. So I'm using this for a flight controller. I need to define an initial orientation from which I can begin performing rotations. How do I express an initial orientation that will work with quaternion multiplication? How do I express yaw = 0, roll = 0 pitch=0 in an orientation quaternion. If I plug these numbers into an Euler to Quaternion formula I get 1,0i,0j,0k . And If I'm to use a "pure quaternion", how can that fully define the orientation of my aircraft. It tells the direction I'm pointed, but doesn't tell anything about how it is rotated about that vector. If the real coefficient is 0, that implies that cos(theta/2) = 0 so theta = 180 degrees. So If I define my reference frame as i=North, j = West and k = up, and I start my aircraft level and pointing north, how do I express this as a quaternion? Would I say 0, 0i, 0j, -k (negative k because the 0 real part implies I'm rotated 180 degrees around the k vector? Do you see my quandry here? Maybe I'm mis-applying quaternions, because I thought they could be used to fully define the orientation, but if that first orientation doesn't include information about the rotation around the vector, it doesn't fully define the aircraft orientation.
@PenguinMaths3 жыл бұрын
@@randysonnicksen9475 I have only used quaternions for rotations in 3D graphics and don't have experience with robotics so I can't speak much to that. But I think you're confusing the roles of the quaternions q and v. When you plug in 0 to the Euler to quaternion calculator you get 1 + 0i + 0j + 0k = 1 since this is a rotation of 0 degrees, aka doing nothing. This is the q quaternion, not v which you're treating it as. So in this case qvq* = 1*v*1 = v so then v is rotated by 0 degrees. And the orientation also is specified by q, not v, which I think is where your confusion is coming from. It's assumed you already have three basis vectors e1, e2, e3 which is your starting orientation. Then you can specify any orientation with the quaternion q, which can transform your basis vectors to qe1q*, qe2q*, qe3q*, which is your original basis vectors rotated to a new orientation. So it's entirely the q quaternion that specifies an orientation and it's the v quaternion that is being rotated to that orientation. So in a sense, every atom of your craft is being represented by it's own quaternion v which specifies the 3D location of that atom from the origin. You could say its starting orientation is specified by the quaternion q_0=1, the "default" orientation. Then you can specify any other orientation with q, which means that for every atom v of the craft, it's new position for that orientation is given by qvq*. In computer graphics this is true except replace the word 'atom' with 'vertex'.
@randysonnicksen94753 жыл бұрын
@@PenguinMaths I think you've nailed it. I was thinking that a quaternion could fully represent the 3D orientation, but no, it only represents a rotation of a point (or 3D vector) to a new point or vector. Just prior to reading your reply I had the idea to use quaternions to track TWO vectors, say the UP vector, and the NORTH vector in 3D space. Any two orthogonal vectors fully define a coordinate system (the 3rd dimension is defined by the normal to the plane defined by the two orthogonal vectors.) While it's not quite as elegant as I was hoping (one calculation), it is still quite efficient to multiply 2 vectors by q and q* to determine the new orientation. I'll still need to figure out how to convert the results into an orientation with respect to the global inertia reference frame, but that should be a simpler problem. I did run across a paper which indicated that it's easiest to do all (quaternion) calcs with reference to the body frame because the gyroscope sensors are attached to the body. It's easier to track the rotation of the earth around the body than to track the body with respect to the earth frame. This same paper also suggested that I could treat the 3 separate gyro readings (x,y,z) as a vector with magnitude sqrt(xx+yy+zz) and do a single rotation instead of rotating around each axis separately. (cool). AND - using a 3D magnetometer and 3D accelerometer, I can get the vectors for magnetic north, and up to "calibrate" my initial conditions, and correct for drift due to offsets in the gyro readings. Thanks for taking the time to read and respond, and to clarify how I was mis-applying the quaternion "v". Much appreciated.
@randysonnicksen94753 жыл бұрын
I did some more research and found the answer I was looking for. In this article www.samba.org/tridge/UAV/madgwick_internal_report.pdf Madgwick explains that two rotation quaternions can be combined with simple multiplication, and the result is a single rotation quaternion which expresses the orientation of a body (frame) with respect to some other frame (say the earth frame). So in this way, the rotation quaternion IS a complete definition of a bodies orientation, whereas the single pure vector is not. Furthermore, we don't need to track two or three vectors to fully define the new orientation. Additionally, we don't need to do a double multiplication qv and (qv)q-1 because the quaternion q contains all the information I need. So if the earth frame is represented as 1,0,0,0 (no rotation), then the orientation of a rotated body is simply the product of all individual sequential rotations multiplied together. This explains what I saw in my arduino program where if I multipled 1,0,0,0 by q only, and not (qv)q-1, I got a result that looked like a valid orientation. I feel like a lot of the information (videos and papers) out there fail to point this out and I feel it is a really important feature of quaternions. BTW, I don't need a reply, but I wanted to post this so that others who are looking for the same information can discover what I did with maybe a little less pain.
@librarymn72512 жыл бұрын
Amazing...
@alexmc4773 жыл бұрын
Holy shit it just clicked
@XYZ_youtube6 ай бұрын
5:50 k!, k factorial xD
@trolleymouse Жыл бұрын
Best explanation I've found and I still don't get it.
@MiljanBojovic3 жыл бұрын
Quaternion, Quarter of an Onion , cut a quarter of the onion and you can see the rings of the onion as rotation and the tunic being the "i" which is like a Forward vector. Jokes apart. Quaternions are a similar concept on how you define magnetic field in a conductor passed by electrical current.
@thomasolson74472 жыл бұрын
My avatar and banner are quaternions in 3d.
@liubai012 жыл бұрын
I am a penguin
@GitBits2 жыл бұрын
Very instructive, thank you. However, your statement at 3:43 "We define the rules of quaternion multiplication" on a background of 9 equations, is a bit misleading. Yes, the rules of quaternion multiplication are defined (They were defined by Hamilton), but they consist of 4 equations, not 9 : i2 = j2 = k2 = ijk = -1 The other equations that you present are of course helpful for actually carrying out the calculations, but they should be understood as being derived from Hamilton's 4 original equations (above). For details on how to do these derivations, see kzbin.info/www/bejne/oJ3WnIR6h51gmLs