3D Rotations and Quaternion Exponentials: Special Case

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024
  • 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.

ความคิดเห็น • 107

  • @razdaman
    @razdaman 7 ปีที่แล้ว +14

    Wonderful explanations. Your videos on geometric algebra and 3D rotations are the best I have ever seen on this subject. Thank you.

  • @RickyMud
    @RickyMud 3 ปีที่แล้ว +2

    At 12:41 shouldn’t the first component of the cross product be -(3^-1/2)

  • @zachreinke
    @zachreinke 8 ปีที่แล้ว +16

    Keep up the excellent instruction!!!!

  • @anchansaxena8988
    @anchansaxena8988 6 ปีที่แล้ว +7

    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 6 ปีที่แล้ว

      I'm confused, why is he not using the pythagorean theorem?

    • @eirikkvalheim8627
      @eirikkvalheim8627 6 ปีที่แล้ว +1

      hahaha, Pythagorean xD

    • @angelmendez-rivera351
      @angelmendez-rivera351 5 ปีที่แล้ว +1

      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.

  • @ThePixelkd
    @ThePixelkd 3 ปีที่แล้ว +2

    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!

  • @cybernaut_ev3106
    @cybernaut_ev3106 5 ปีที่แล้ว +2

    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.

  • @shif674
    @shif674 4 ปีที่แล้ว +2

    Thank you so much! this is amazingly helpful!

  • @craigmatthews4517
    @craigmatthews4517 4 ปีที่แล้ว +1

    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.

  • @andrewbeechey4402
    @andrewbeechey4402 5 ปีที่แล้ว +2

    Nice work :). Any chance you could also cover Octonions and/or Sedenions?

  • @diegorblandon
    @diegorblandon 7 ปีที่แล้ว +2

    Thank you so much for the excellent instruction, please keep them coming.

  • @marcushellstrom1157
    @marcushellstrom1157 7 ปีที่แล้ว +1

    I like the guts of taking on the arbitrary hardship of quarternions explicitly in this day and age!

  • @gtagamer6962
    @gtagamer6962 3 ปีที่แล้ว +1

    Ohhh that made my day

  • @mqrieck
    @mqrieck 5 ปีที่แล้ว +1

    Very well done! (I would never suggest doing such a thing with your quaternions!)

  • @marcushendriksen8415
    @marcushendriksen8415 5 ปีที่แล้ว +1

    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.

  • @danielbodmer6168
    @danielbodmer6168 6 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      Daniel Bodmer Because the basis of the coordinate system is known as the Cartesian basis, and Descartes used x, y, z.

  • @TyTheRegularMan
    @TyTheRegularMan 6 ปีที่แล้ว +7

    This is fascinating and mind-blowing.

  • @mktsp2
    @mktsp2 2 หลายเดือนก่อน

    I think the direction of n^ x v is wrong. It should look the opposite direction. Am I right?

  • @matematica_do_zero
    @matematica_do_zero 5 ปีที่แล้ว +2

    Muito Bom!!! Obrigado!

  • @algerianteachersteam8805
    @algerianteachersteam8805 6 ปีที่แล้ว +1

    thank you for this video. I like your way of explanation

  • @zachreinke
    @zachreinke 8 ปีที่แล้ว +2

    Great Examples!!!!!

  • @saltcheese
    @saltcheese 7 ปีที่แล้ว +1

    keep making these high quality insightful explanations. much appreciated!

  • @qwertyqwerty00700700
    @qwertyqwerty00700700 7 ปีที่แล้ว +1

    Great video. Small question, why does the axis of rotation have to be unit?

    • @Math_oma
      @Math_oma  7 ปีที่แล้ว +2

      +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.

  • @HowToDrinkMilkk
    @HowToDrinkMilkk ปีที่แล้ว

    explained better than my professor!!!!

  • @apkiller10
    @apkiller10 3 ปีที่แล้ว

    2u talk fast but redo in text 2 speech more views

  • @dorkusschmleck9781
    @dorkusschmleck9781 6 ปีที่แล้ว +1

    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 ปีที่แล้ว +2

      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 ปีที่แล้ว +1

      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 4 หลายเดือนก่อน

      So clearly explained. Great video.

  • @아지-d3r
    @아지-d3r 4 ปีที่แล้ว +1

    Thank you!

  • @harshavardhansripathi66
    @harshavardhansripathi66 4 ปีที่แล้ว

    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

  • @adityadas.mr.cosmos357
    @adityadas.mr.cosmos357 5 ปีที่แล้ว +1

    Well taught

  • @mohankrishnan2022
    @mohankrishnan2022 7 ปีที่แล้ว +1

    Excellent set of videos on Quaternions!

  • @fizixx
    @fizixx 7 ปีที่แล้ว

    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.

  • @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 👌

  • @datsnek
    @datsnek 7 ปีที่แล้ว

    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/

  • @sarthakghosh1635
    @sarthakghosh1635 5 ปีที่แล้ว +1

    This is the best video ever!!

  • @Khether0001
    @Khether0001 6 ปีที่แล้ว +4

    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!*

  • @kirtanvora3789
    @kirtanvora3789 6 ปีที่แล้ว +1

    Fabulous Explanation

  • @kellywshere
    @kellywshere 7 ปีที่แล้ว +1

    Great explanation! Thanks!

  • @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?

  • @yiyiguxing
    @yiyiguxing 6 หลายเดือนก่อน

    Thank you!

  • @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

  • @mollejalopez8012
    @mollejalopez8012 ปีที่แล้ว

    Lo amo. Empieza desde cero y va construyendo todo ❤

  • @vivekdabholkar5965
    @vivekdabholkar5965 5 หลายเดือนก่อน

    Great job!

  • @StanislavBashkirtsev
    @StanislavBashkirtsev 3 ปีที่แล้ว

    The drawing showed vxn instead of nxv..

  • @habotssar8429
    @habotssar8429 7 ปีที่แล้ว

    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!

  • @ΝικόλαοςΜελάς-π2γ
    @ΝικόλαοςΜελάς-π2γ 7 ปีที่แล้ว +1

    perfect! well done

  • @Khether0001
    @Khether0001 6 ปีที่แล้ว +3

    *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 ปีที่แล้ว +1

      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!

  • @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

  • @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.

  • @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

  • @ilafya
    @ilafya 3 ปีที่แล้ว

    Thank you
    You are the Man man

  • @pgmz
    @pgmz 4 ปีที่แล้ว

    excellent explanations! Mind blowing!

  • @brendawilliams8062
    @brendawilliams8062 4 ปีที่แล้ว

    Thankyou.

  • @pratiktohidayat1746
    @pratiktohidayat1746 7 ปีที่แล้ว

    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

  • @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 ปีที่แล้ว +1

      +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.

  • @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

  • @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 7 ปีที่แล้ว +2

      v does not have to be unit length, because |v|=|n×v| as long as |n|=1

    • @Math_oma
      @Math_oma  7 ปีที่แล้ว

      +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.

  • @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

  • @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 ปีที่แล้ว +1

      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.

  • @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 ปีที่แล้ว +1

      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.

  • @abhiroop100
    @abhiroop100 5 ปีที่แล้ว

    very well explained !!