3D Rotations and Quaternion Exponentials: Special Case

  Рет қаралды 98,369

Mathoma

Mathoma

8 жыл бұрын

In this video, we'll understand 3D rotations from the point of view of vector analysis and quaternions. We will solve the problem of rotating a vector which is perpendicular to the axis of rotation in this video which will help us solve the general case in the next video. We will especially see that the role of the exponential function and Euler's formula in rotations, just as we noticed for the complex numbers, this time with a quaternion power instead of a complex number.

Пікірлер: 106
@razdaman
@razdaman 6 жыл бұрын
Wonderful explanations. Your videos on geometric algebra and 3D rotations are the best I have ever seen on this subject. Thank you.
@zachreinke
@zachreinke 8 жыл бұрын
Keep up the excellent instruction!!!!
@saltcheese
@saltcheese 7 жыл бұрын
keep making these high quality insightful explanations. much appreciated!
@diegorblandon
@diegorblandon 7 жыл бұрын
Thank you so much for the excellent instruction, please keep them coming.
@mollejalopez8012
@mollejalopez8012 9 ай бұрын
Lo amo. Empieza desde cero y va construyendo todo ❤
@craigmatthews4517
@craigmatthews4517 3 жыл бұрын
This was great! Really appreciate working through the examples. I have seen some people try and explain Quaternions visually, but it left me scratching my head and I don't have a lot of hair to begin with.
@mohankrishnan2022
@mohankrishnan2022 7 жыл бұрын
Excellent set of videos on Quaternions!
@sarthakghosh1635
@sarthakghosh1635 5 жыл бұрын
This is the best video ever!!
@shif674
@shif674 3 жыл бұрын
Thank you so much! this is amazingly helpful!
@kellywshere
@kellywshere 7 жыл бұрын
Great explanation! Thanks!
@marcushellstrom1157
@marcushellstrom1157 7 жыл бұрын
I like the guts of taking on the arbitrary hardship of quarternions explicitly in this day and age!
@pgmz
@pgmz 4 жыл бұрын
excellent explanations! Mind blowing!
@algerianteachersteam8805
@algerianteachersteam8805 6 жыл бұрын
thank you for this video. I like your way of explanation
@TyTheRegularMan
@TyTheRegularMan 6 жыл бұрын
This is fascinating and mind-blowing.
@mqrieck
@mqrieck 5 жыл бұрын
Very well done! (I would never suggest doing such a thing with your quaternions!)
@zachreinke
@zachreinke 8 жыл бұрын
Great Examples!!!!!
@matematica_do_zero
@matematica_do_zero 4 жыл бұрын
Muito Bom!!! Obrigado!
@kirtanvora3789
@kirtanvora3789 6 жыл бұрын
Fabulous Explanation
@vivekdabholkar5965
@vivekdabholkar5965 2 ай бұрын
Great job!
@datsnek
@datsnek 6 жыл бұрын
Took me 2 months to forget all about cross and dot products. Goddamn holidays!;) Gonna take a stub at graphics programming with the knowledge of this stuff. Thanks/
@cybernaut_ev3106
@cybernaut_ev3106 5 жыл бұрын
It's incredible the way you break this down. This is probably how the mathematics originated, by using diagrams and putting it together. Unfortunately, today, you're simply shown the math and left to your own devices. It's no wonder people can't understand quaternions. Your videos should be used to teach students where it all comes from.
@HowToDrinkMilkk
@HowToDrinkMilkk Жыл бұрын
explained better than my professor!!!!
@nameismyname6055
@nameismyname6055 3 жыл бұрын
"As someone who believes in keeping the abstract nonsense to a minimum" Pffff i love you man. Keep up the amazing instructions 👌
@ilafya
@ilafya 3 жыл бұрын
Thank you You are the Man man
@fizixx
@fizixx 6 жыл бұрын
Hahahaha.....no, I'm not gonna tell you to shove your Quaternions. This is a very understandable, clearly explained piece on Quaternions. I hope you do more videos.
@harshavardhansripathi66
@harshavardhansripathi66 3 жыл бұрын
Thank you very much man, I really wanna hug u man, I was having difficulty in understanding quarternions Every one nd every book tells me that they represent rotation nd no one tells why Love from India
@user-qk1si5cd9m
@user-qk1si5cd9m 4 жыл бұрын
Thank you!
@user-yw5yr4mk2c
@user-yw5yr4mk2c 7 жыл бұрын
perfect! well done
@gtagamer6962
@gtagamer6962 2 жыл бұрын
Ohhh that made my day
@adityadas.mr.cosmos357
@adityadas.mr.cosmos357 5 жыл бұрын
Well taught
@dorkusschmleck9781
@dorkusschmleck9781 6 жыл бұрын
I am a math junky who after 48 years of life on earth with no mention of quaternions has now run into them twice in one year - in robotics and in 3D animation software. Your videos are totally perfect for teaching me what these things are. Edit - Feel free to read my comment below but I figured out where I was going wrong after watching the next video in this series. I had thought that e^(i + j + k) would be (cos + isin)*(cos+jsin)*(cos+ksin), but that is incorrect even though I am following the laws of exponentiation properly. The actual answer is ( cos + isin + jsin + ksin), much easier but not intuitive to me. ____________________________________________________________________________________________ That being said, I wanted to explore the v' = (e^(theta n))v you gave us at 19:25 I want to do a more difficult example. I want to rotate the vector k 90 degrees around vector i + j, and since k is perpendicular to i + j the magic formula above should work. But something is amiss in my calculations or assumptions. v' should be e^((pi/(2*sgrt(2))*(i + j)) k . (the sqrt(2) is from normalizing i + j). PI/(2*sqrt(2) in degrees is approx 64, good enough for the example below. So we have: (cos64 + isin(64)) times (cos64 + jsin(64) times k which is ( cos(64)^2 + isin(64)cos(64) +jsin(64)cos(64) +ksin(64)sin(64) )k which is ( k c(64)^2 - (j s(64)c(64)) + (i s(64)c(64)) - s(64)^2) = MESS, I THINK Rotating K 90 degrees around i + j, by visual analysis, should give us (i - j)/sqrt(2) or (-i + j)/sqrt(2) depending on which way we go 90 . But I get the mess above. If anyone wants to chime in as to what I did wrong please do!
@allmycircuits8850
@allmycircuits8850 6 жыл бұрын
You were a little in hurry there. Let's write down vector n: n = (i + j) / sqrt(2) this square root of 2 is inside n, because it must be a unit vector for this formula to work properly. So v' = e^(pi/2 * n) k = (cos(pi/2) + sin(pi/2) n)k = 0 + nk = (i + j) / sqrt(2) * k = (ik + jk) / sqrt(2) = (-j + i) / sqrt(2) which is correct answer. The mistake was that you put 1/sqrt(2) multiplier into angle, while it should go into n vector and stay there, while angle remains to be 90 degrees!
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
You also did not actually use the rules of exponentiation correctly. Notice that the rules are different for quaternions because multiplication is not commutative.
@roberthayter157
@roberthayter157 Ай бұрын
So clearly explained. Great video.
@andrewbeechey4402
@andrewbeechey4402 5 жыл бұрын
Nice work :). Any chance you could also cover Octonions and/or Sedenions?
@RickyMud
@RickyMud 3 жыл бұрын
At 12:41 shouldn’t the first component of the cross product be -(3^-1/2)
@ThePixelkd
@ThePixelkd 3 жыл бұрын
Hey, love these video. I am trying to find out if there are any solutions for a specific application for games and animation. Specifically, I am trying to represent 3d rotation with a 2d animation rig. I know that I can represent rotation with a subset of images (front, 3/4, profile, etc..) and that the rest can be created using rotations of those flat images (head tilting to the side, for example). Do you know of any work that has dealt with this issue using quaternions before? Thanks for all the awesome videos!
@habotssar8429
@habotssar8429 6 жыл бұрын
in vector analysis if you have n vectors in the Rn-1 space, any vector in this space can be expressed as a linear combination of the remaining n-1 vectors!
@brendawilliams8062
@brendawilliams8062 3 жыл бұрын
Thankyou.
@abhiroop100
@abhiroop100 5 жыл бұрын
very well explained !!
@Khether0001
@Khether0001 6 жыл бұрын
*man, thank you so much it does help a lot! thanks!* _hey, now... who still needs to master your anatomy... and animation... and painting... and coding... and fashion... and texturing/illumination/rendering?... and half a dozen softwares? and... still hear your game "suuuux"? and "whyyy is it taking sooo LOOOOOONG???"_ 😉
@ScienceDiscoverer
@ScienceDiscoverer 6 жыл бұрын
I know this feel T___T Espassialy cos I try to create my game from scratch, without any premade engine, like all the weaklings do!
@AchrajSarma
@AchrajSarma 4 жыл бұрын
How does the fact that n_hat and the plane pass through the origin factor in? Does it affect the formulae if we don't have that condition?
@marcushendriksen8415
@marcushendriksen8415 5 жыл бұрын
I'm a bit confused about quaternions. Going by this video, it's perfectly valid to use i, j and k as synonyms (for lack of a better word) for the x, y and z axes, and that these together comprise the "vector" part of the quaternion. That's fine, I completely understand the logic there. But what does the scalar part translate into in our 3D experience? The best answer I can come up with (using the normal complex exponentiation as an analogy) is that it "scales" the i, j and k components, thus scaling the total distance we would measure between the origin and the endpoint, say with a ruler. Is that right?
@michaelstark2832
@michaelstark2832 2 жыл бұрын
The scalar parts are just the cos and sin of the angle we are rotating thru. They have nothing to do with the vector part. You decide what that angle will be. It's just the result of Hamilton's notation.
@qwertyqwerty00700700
@qwertyqwerty00700700 7 жыл бұрын
Great video. Small question, why does the axis of rotation have to be unit?
@Math_oma
@Math_oma 7 жыл бұрын
+Aditi Hebbar It makes the derivation easy and allows us to use the fact that such a vector (written as a quaternion) squares to -1 which allows us to use Euler's formula. Supposing a given axis were not unit, it can be made unit by dividing by its magnitude anyway.
@danielbodmer6168
@danielbodmer6168 6 жыл бұрын
Excellent explanation!! But why do you call the axis of the coordinate system x-y-z instead of i-j-k? I mean it is absolutely clear what you mean I was just wondering?! (I am speaking about your sketch at 21:20)
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Daniel Bodmer Because the basis of the coordinate system is known as the Cartesian basis, and Descartes used x, y, z.
@MrChrisRab
@MrChrisRab 7 жыл бұрын
Will you also make a video on the classical and modified Rodriguez parameters? I think they both are much easier to play with when doing rotations.
@Math_oma
@Math_oma 7 жыл бұрын
+MrChrisRab I'm not familiar with those but when I stumble upon _parameters_ used in rotations, they often seem to be components of a quaternion in disguise. Is there something gained with these classical or modified Rodrigues parameters that isn't already there with quaternions?
@MrChrisRab
@MrChrisRab 7 жыл бұрын
Yes, quaternions are by far the most used, which sadness the people who have used CRPs or MRPs (Classical/Modified Rodriguez Parameters). Both CRPs and MRPs have an easy transformation from quaternions (also called Euler angles). They both are represented solely by three coordinates (instead of the four in quaternions), which allows us to do easy linear algebra on them as if they were dimensional vectors (but they don't represent a location in space, only a rotation!). CRPs and MRPs have useful properties when it comes to take the time derivative of the rotation (when seeking the angular rate): they both are effectively a matrix multiplied by the three coordinate representation of the parameter as a vector. One disadvantage of the CRP is that they become singular at rotations of +/-180 degrees. Similarly the MRPs go singular at +/- 360 degrees. However, in both cases we define the *RPs with their "shadow set" which tracks the same rotation but from the long way (i.e. instead of going from 350 degrees to 20 degrees via zero, it'll go from 350 to 20 backward). Another very big advantage in terms of application is that both the CRPs and MRPs have simple linearizations: the CRP is effectively the principal rotation vector multiplies by tan(theta/2), and the MRP is the same but by tan(theta/4). Pages 112-126 of "Analytical Mechanics of Space Systems" covers these parameters very well. And of course, I'm more than willing to talk a little bit about them.
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
MrChrisRab There is objectively no advantage to be gained from the parameters that there is not to gain from quaternions. In fact, the parameters are technically derived from quaternion algebra.
@anchansaxena8988
@anchansaxena8988 6 жыл бұрын
You should mention that v, v' and (n x v) are all equal to v in length. Then only your equation v' = cos(theta)*v + sin(theta)*(n x v) is valid otherwise it is actually wrong trigonometry if you state that directly.
@lamontalvo96
@lamontalvo96 5 жыл бұрын
I'm confused, why is he not using the pythagorean theorem?
@eirikkvalheim8627
@eirikkvalheim8627 5 жыл бұрын
hahaha, Pythagorean xD
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
There is no need to mention it since it is included in the very definition of the cross product and of rotation: rotations never alter the magnitude of a vector. In fact, mentioning it would make the video more confusing and complicated. It is obvious why the decomposition is valid: it is a rotation. Again, that is essentially the definition of a rotation.
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Callidus 32 why would he? At no point in the video was it necessary nor would it have produced any data that was needed
@nikhilbagul7189
@nikhilbagul7189 4 жыл бұрын
@@angelmendez-rivera351 Hey Angel, thanks for mentioning that albeit @Anchan is right here since it is implied and not expressed explicitly. It maybe straightforward for some but not for others. If we are here to see the proof then we expect a step by step derivation.
@jananraj6680
@jananraj6680 5 жыл бұрын
Around the 8:20 mark, how did you derive it to be sin(theta) N x V’ ? Couldn’t derive it using the usual sine cosine trig rules
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Janan Rajaratnam It is in the video
@Khether0001
@Khether0001 6 жыл бұрын
sigh... nope too theoretical now... still have to figure out in maxscript how to put all the bones into an array and mirror their rotations... but this went far too away... sigh... will keep trying though
@pratiktohidayat1746
@pratiktohidayat1746 6 жыл бұрын
sir, in 9:54 you change the n head compenent to a unit. does it efect the result of rotation in n head axis?
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Pratikto Hidayat you cannot rotate with respect to a non-unit vector, not technically or without modifications
@xxxXLopesXxxx
@xxxXLopesXxxx 7 жыл бұрын
How can I find the value of ñ x v manually at 12:30?
@Math_oma
@Math_oma 7 жыл бұрын
+Pedro Lopes The way the cross product calculation is usually taught is by setting up a 3x3 matrix and finding the determinant: en.wikipedia.org/wiki/Cross_product#Matrix_notation
@OsamaAdel
@OsamaAdel 7 жыл бұрын
One thing I can't get very well is what that scalar part of a quaternion is for? what does it represent geometrically?
@Math_oma
@Math_oma 7 жыл бұрын
+Osama Adel Supposing the quaternion to be of unit length, the scalar part is the cosine of the half-angle in the rotation.
@OsamaAdel
@OsamaAdel 7 жыл бұрын
Ok(!!) .. but Why?!! I mean, quaternions are just like vectors but with their components disassembled and each component is multiplied by a unit vector of its corresponding axis - which is completely fine .. but then comes the scalar part spoiling my understanding .. I don't get why it is there ?
@Math_oma
@Math_oma 7 жыл бұрын
+Osama Adel But you should try to understand what the scalar is doing through the development of the algebra, not just examine the quaternion. What I said above follows from the way the rotation formula turns out as an exponential. For example, in this video (and in the accompanying video: general case) did you have any specific questions?
@marcushellstrom1157
@marcushellstrom1157 7 жыл бұрын
If you've experienced applied physics, its a vector field (I reckon); a vecorial function with real output (this "just" involves an algebra aswell!
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Osama Adel It does not represent anything geometrically. Paravectors are very difficult to understand geometrically, and quaternions are just paravectors. They are not mere vectors. This is why in order for them to be geometrically useful, we let the scalar part be 0.
@nyfpos
@nyfpos 7 жыл бұрын
I afraid the result of example not to be correct in the formula. Because the length of vector v (1,-1,0) would not be 1. In the formula both of vectors n and v are unit vector, right?
@nyfpos
@nyfpos 7 жыл бұрын
The other question, is the length of v, v' and cross(n,v) be the same?
@nyfpos
@nyfpos 7 жыл бұрын
So the vector v (1, -1, 0) can not be normalized. And the formula still work?
@raphaelmillion
@raphaelmillion 6 жыл бұрын
v does not have to be unit length, because |v|=|n×v| as long as |n|=1
@Math_oma
@Math_oma 6 жыл бұрын
+Raphael Million Right. I've deleted my comments above because they were mistaken. The example seems to be fine in this video.
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
No, in the formula, only n is a unit vector. v and v’ need not be unit vectors.
@nikhilbagul7189
@nikhilbagul7189 4 жыл бұрын
This may sound stupid. At 7:55 I really didn't understand how vector along V was calculated as V cos Θ. Based on my understanding the projection is always |V| cos Θ. Can anyone please explain?
@nikhilbagul7189
@nikhilbagul7189 4 жыл бұрын
@Pray Always I assumed that but wasn't sure if that is correct. Thanks a lot for clarifying the misconception here and shedding light. You are a real purist.
@diegodelponte9037
@diegodelponte9037 2 жыл бұрын
Nickhil I have the same problem
@jaffarmohiddin4258
@jaffarmohiddin4258 6 жыл бұрын
Hi, please clarify, how v has same length as (n*v).
@Math_oma
@Math_oma 6 жыл бұрын
The length of n X v must be the amount of area contained in the parallelogram defined by the vectors n and v - that comes from what the cross product is. That parallelogram is a rectangle with side lengths 1 and |v| because n is of unit length and orthogonal to v, so n X v must be of length |v|.
@jaffarmohiddin4258
@jaffarmohiddin4258 6 жыл бұрын
Thank you
@jaffarmohiddin4258
@jaffarmohiddin4258 6 жыл бұрын
Hi, I have converted rodrigue vectorial form to matrix form but having one doubt. Can you derive this so that I can check where I have gone wrong. Please
@Khether0001
@Khether0001 6 жыл бұрын
so I need to write a script... using quaternions... to locally mirror the rotation the bones of my character in 3dsmax... so I can rig it properly... to do all the animations... that I'll use in my timeline in Unreal... so the character I've modeled... can show a proper behavior on his extensor carpi radialis longus... and have it not intersect the mesh when you are applying physics simulation of cloth and hair... ... ... *SIMPLE!*
@ScienceDiscoverer
@ScienceDiscoverer 6 жыл бұрын
EZ
@DineshKumar-zw7vg
@DineshKumar-zw7vg 4 жыл бұрын
If v and n hat passes through origin then they are not perpendicular. Then the rotation is not in a cone shaped plane, it's actually in a disc.
@DineshKumar-zw7vg
@DineshKumar-zw7vg 4 жыл бұрын
Of course i am saying for the example part only.
@StanislavBashkirtsev
@StanislavBashkirtsev 3 жыл бұрын
The drawing showed vxn instead of nxv..
@OlayRivera
@OlayRivera 7 жыл бұрын
why ňxv=v' ?
@Math_oma
@Math_oma 7 жыл бұрын
+Olay Rivera If n and v are orthogonal (as in the video), with n serving as a normal vector to a plane, crossing the two, n x v, will produce a vector which is orthogonal to both n and v. Because it is orthogonal to n, this vector must be in that plane and because it's orthogonal to v, the new vector, v', will be rotated pi/2 radians with respect to v.
@thecelt4807
@thecelt4807 2 жыл бұрын
give me a real life scenario where this understanding of such will apply to a situational use of the understanding other than out in orbit
@terrylarson7141
@terrylarson7141 6 жыл бұрын
What would be the purpose of multiplying one 4-dimensional vector by another? For that matter why would one want to add two 4-dimensional vectors? The answer may lay in your other videos and it is my aim to watch them. But for the moment, I have to go mop up my brain off the floor since it just exploded.
@allmycircuits8850
@allmycircuits8850 6 жыл бұрын
Don't be too ashamed: Hamilton himself tried to come up with 3-dimensional equivalent of complex numbers to represent 3D rotations. He was struggling for 10 years before he finally came up with idea of quaternions! Later it was proved that 'complex' numbers with 2 imaginary parts cannot succeed in this task, no matter how you define multiplication rules. I still don't know exactly intuitive proof of this fact, the shortest proof uses the fact that any 3x3 matrix will always have at least one real eigenvalue, which means there is always degenerate case when multiplication of 2 non-zero 'complex' numbers results in zero. Not good for rotations, because you want multiplication to be always reversible (if you rotated some object, you can always rotate it back!) which is not the case here. Another reason is hairy ball theorem. Turns out, there is no good way to describe rotations using just 3 numbers. There always will be some points where rotation with finite velocity requires infinitely fast change in one of variables you use to describe rotation. For example, when using azimuth and elevation and going exactly through zenith (90 degree elevation), azimuth changes abruptly from 0 to 180. What's more, there is ambiguity in azimuth when in elevation = 90. So 3 numbers are too little, but 4 numbers are OK and that's what quaternions are.
@angelmendez-rivera351
@angelmendez-rivera351 5 жыл бұрын
Terry Larson This fact I will tell you is counterintuitive, but true nonetheless. The fact is that in order to perform rotations and scales geometrically in 3 dimensions, you require a 4-dimensional algebra, which is why we use quaternions. Similarly, if you wanted to describe geometric manipulations in 4 dimensions, you need an algebra with 8 dimensions, which is where octonions come in. In general, dealing with Euclidean geometry in N-dimensions requires an algebra with 2^(N-1) dimensions. There is no 0-dimensional geometry, but 1-dimensional geometry obviously only needs the real numbers, which is algebra in 1 dimensions, and 2 dimensions requires an algebra with 2 dimensions because it so happens that N = 2^(N-1) has solutions N = 1 and N = 2.
@michaelstark2832
@michaelstark2832 2 жыл бұрын
@@angelmendez-rivera351 These are not 4-dimensional vectors. Quaternions are mathematical objects with a scalar part(in this case,the cos of half the angle of desired rotation),and a 3 dimensional vector part.
@apkiller10
@apkiller10 3 жыл бұрын
2u talk fast but redo in text 2 speech more views
@yiyiguxing
@yiyiguxing 3 ай бұрын
Thank you!
Quaternions: Extracting the Dot and Cross Products
18:49
Mathoma
Рет қаралды 25 М.
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 24 МЛН
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 11 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 9 МЛН
Geometric Algebra  - 3D Rotations and Rotors
48:59
Mathoma
Рет қаралды 21 М.
Quaternions
39:07
UC Davis Academics
Рет қаралды 169 М.
a quaternion version of Euler's formula
20:33
Michael Penn
Рет қаралды 72 М.
Quaternions EXPLAINED Briefly
17:51
Mathoma
Рет қаралды 301 М.
Fantastic Quaternions - Numberphile
12:25
Numberphile
Рет қаралды 1 МЛН
3D Reflections with Vectors and Quaternions
23:44
Mathoma
Рет қаралды 19 М.
How (and why) to raise e to the power of a matrix | DE6
27:07
3Blue1Brown
Рет қаралды 2,7 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,5 МЛН
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 1,2 МЛН