consistent orientation/quaternion handling is in own submodule
This commit is contained in:
parent
7fa979f800
commit
f6c616c84b
29
src/math.f90
29
src/math.f90
|
@ -933,35 +933,6 @@ pure function math_Voigt66to3333(m66)
|
|||
end function math_Voigt66to3333
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief quaternion multiplication q1xq2 = q12
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
pure function math_qMul(A,B)
|
||||
|
||||
real(pReal), dimension(4) :: math_qMul
|
||||
real(pReal), dimension(4), intent(in) :: A, B
|
||||
|
||||
math_qMul = [ A(1)*B(1) - A(2)*B(2) - A(3)*B(3) - A(4)*B(4), &
|
||||
A(1)*B(2) + A(2)*B(1) + A(3)*B(4) - A(4)*B(3), &
|
||||
A(1)*B(3) - A(2)*B(4) + A(3)*B(1) + A(4)*B(2), &
|
||||
A(1)*B(4) + A(2)*B(3) - A(3)*B(2) + A(4)*B(1) ]
|
||||
|
||||
end function math_qMul
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief quaternion conjugation
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
pure function math_qConj(Q)
|
||||
|
||||
real(pReal), dimension(4) :: math_qConj
|
||||
real(pReal), dimension(4), intent(in) :: Q
|
||||
|
||||
math_qConj = [Q(1), -Q(2:4)]
|
||||
|
||||
end function math_qConj
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief action of a quaternion on a vector (rotate vector v with Q)
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue