Quaternions for Rotation

Quaternions for Rotation
Loading the math board and drawing, please wait…
2017-03-09 22:05
This example demonstrates the application of quaternions in rotation. Key mathematical concepts include quaternions and rotation. Using GeoGebra commands such as TextField, Line, Rotate, etc., the conversion from quaternions to rotation is constructed. Suitable for high school students or math enthusiasts learning about quaternion and rotation transformations.

GeoGebra Commands & Parameters

  1. Textfield(A) → InputBox1
  2. Textfield(angle1) → InputBox2
  3. Textfield(B) → InputBox3
  4. Textfield(angle2) → InputBox4
  5. Textfield(P) → InputBox5
  6. q2m(Q1) → M1
  7. q2m(Q2) → M2
  8. q2m(Qp) → Mp
  9. m2q((M2 * M1)) → Qt
  10. m2q(((q2m[Qt] * Mp) * q2m[qconj[Qt]])) → Qp'
  11. Line((0, 0), B) → g
  12. Line((0, 0), A) → f
  13. Rotate(P, angle1, f) → R
  14. If(0 < t < 1, Rotate[P, (t * angle1), f], If[1 < t < 2, Rotate[R, ((t - 1) * angle2), g]]) → S
  15. Circle(g, R) → c
  16. Circle(f, P) → d
  17. Circle(Line[(0, 0, 0), (Element[Qt, 2, 1], Element[Qt, 3, 1], Element[Qt, 4, 1])], P) → e
  18. Line((0, 0, 0), (Element[Qt, 2, 1], Element[Qt, 3, 1], Element[Qt, 4, 1])) → h
  19. Cylinder(P + (0, 0, 0.4), P - (0, 0, 0.4), 0.3) → l, l_2, l_3, l_4
  20. Sphere(P + (0, 0, 0.75), 0.4) → j
  21. Cylinder(P + (0, -0.2, 0.35), P + (0.2, -0.75, 1), 0.15) → m, m_5, m_6, m_7
  22. Cylinder(P + (0, -0.1, -0.35), P + (0, -0.5, -1.2), 0.2) → k, p, q, n
  23. Cylinder(P + (0, 0.1, -0.35), P + (0, 0.5, -1.2), 0.2) → o, r, s, u
  24. Cylinder(P + (0, 0.2, 0.35), P + (0.7, 0.6, 0.45), 0.15) → m_4, m_2, m_3, m_4
  25. Rotate(k, angle1, f) → k'
  26. Rotate(l, angle1, f) → l'
  27. Rotate(m, angle1, f) → m'
  28. Rotate(m_4, angle1, f) → v
  29. Rotate(o, angle1, f) → o'
  30. Rotate(j, angle1, f) → j'
  31. Rotate(k, (t * angle1), f) → k'_1
  32. Rotate(l, (t * angle1), f) → l'_1
  33. Rotate(m, (t * angle1), f) → m'_1
  34. Rotate(m_4, (t * angle1), f) → w
  35. Rotate(o, (t * angle1), f) → o'_1
  36. Rotate(j, (t * angle1), f) → j'_1
  37. Rotate(k', ((t - 1) * angle2), g) → k''
  38. Rotate(l', ((t - 1) * angle2), g) → l''
  39. Rotate(m', ((t - 1) * angle2), g) → m''
  40. Rotate(o', ((t - 1) * angle2), g) → o''
  41. Rotate(v, ((t - 1) * angle2), g) → v'
  42. Rotate(j', ((t - 1) * angle2), g) → j''
  43. Rotate(k', angle2, g) → k''_1
  44. Rotate(l', angle2, g) → l''_1
  45. Rotate(m', angle2, g) → m''_1
  46. Rotate(o', angle2, g) → o''_1
  47. Rotate(v, angle2, g) → v'_1
  48. Rotate(j', angle2, g) → j''_1
  49. Rotate(l, (t / 2 * angle3), h) → l'_2
  50. Rotate(k, (t / 2 * angle3), h) → k'_2
  51. Rotate(m, (t / 2 * angle3), h) → m'_2
  52. Rotate(m_4, (t / 2 * angle3), h) → a_1
  53. Rotate(o, (t / 2 * angle3), h) → o'_2
  54. Rotate(j, (t / 2 * angle3), h) → j'_2