Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Say you want to rotate A toward B.</p> <p>Take the cross product AxB = C and normalize it.</p> <p><strike>Now break A into two components, one parallel to C and one normal:</strike></p> <pre><code>... </code></pre> <p><strike>Now construct a vector normal to A and C (with the right sense):</strike></p> <pre><code>... </code></pre> <p><strike>Now you can construct the rotated vector:</strike></p> <pre><code>... </code></pre> <p><b>EDIT</b><br> I feel like an idiot. The correct (and more simple) derivation is</p> <pre><code>F = C x A G = cos(theta) A + sin(theta) F </code></pre> <p><b>EDIT:</b><br> This works by simple geometry. C is normal to the plane containing A and B. F is in the plane, and normal to A. So any vector in the plane is a linear combination of A and F; that is, any vector Z in the plane can be constructed as Z = aA + bF, where a and b are numbers, and any such sum will be in the plane. F also has the same magnitude as A, so if we construct</p> <pre><code>G = cos(theta) A + sin(theta) F </code></pre> <p>what we get is a vector with the same magnitude, but separated from A by an angle theta. (This is not immediately obvious, but if you play around with it a little you'll see that it works.)</p> <p>Using your example:</p> <pre><code>A = (2, 3, 3) (magnitude = 4.69) B = (2, -3, -2) C = AxB = (3, 10, -12) (magnitude = 15.906) Now normalize: C = (0.189, 0.629, -0.754) (magnitude = 1.0) F = CxA = (4.149, -2.075, -0.692) (magnitude = 4.69) theta = 20 degrees G = cos(theta) A + sin(theta) F = (3.299, 2.109, 2.583) (magnitude = 4.69) </code></pre> <p>G is in the same plane as A and B (normal to C), and the angle between A and G is 20 degrees. (The angle between A and B is 124.7 degrees, the angle between G and B is 104.7 degrees.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload