Documentation

LeanPool.Rupert.Quaternion

LeanPool.Rupert.Quaternion #

Imported Lean Pool material for LeanPool.Rupert.Quaternion.

def matrixOfQuat {R : Type} [Field R] (q : Quaternion R) :
Matrix (Fin 3) (Fin 3) R

Converts a quaternion to a normalized rotation matrix.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def denormMatrixOfQuat {R : Type} [Field R] (q : Quaternion R) :
    Matrix (Fin 3) (Fin 3) R

    A version of converting quaternions to matrices without normalization, under the assumption that it might be easier to reason about it postponing the divisions until later.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem normalized_denorm_is_matrix {R : Type} [Field R] (q : Quaternion R) :
      match q with | { re := w, imI := x, imJ := y, imK := z } => have normsq := w ^ 2 + x ^ 2 + y ^ 2 + z ^ 2; matrixOfQuat q = (1 / normsq) denormMatrixOfQuat q

      The normalized quaternion matrix is a scalar multiple of the denormalized matrix.

      noncomputable def rotateXQuat (θ : ) :

      Quaternion for rotation about the x-axis by angle θ.

      Equations
      Instances For
        noncomputable def rotateXMat (θ : ) :
        Matrix (Fin 3) (Fin 3)

        Matrix for rotation about the x-axis by angle θ.

        Equations
        Instances For
          noncomputable def rotateToTarget (src tgt : ℝ³) :

          Quaternion rotating src toward tgt.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For