this is a quaternion class
it is meant to represent any quaternion, not only unit quaternions/rotations that follow a specific convention. Need to check in rotations.f90 where the homomorph should happen
This commit is contained in:
parent
79cafebffe
commit
aefd401e8c
|
@ -435,7 +435,6 @@ pure function asArray(self)
|
||||||
class(quaternion), intent(in) :: self
|
class(quaternion), intent(in) :: self
|
||||||
|
|
||||||
asArray = [self%w,self%x,self%y,self%z]
|
asArray = [self%w,self%x,self%y,self%z]
|
||||||
if (self%w < 0) asArray = -asArray
|
|
||||||
|
|
||||||
end function asArray
|
end function asArray
|
||||||
|
|
||||||
|
@ -475,7 +474,7 @@ subroutine unitTest
|
||||||
type(quaternion) :: q, q_2
|
type(quaternion) :: q, q_2
|
||||||
|
|
||||||
call random_number(qu)
|
call random_number(qu)
|
||||||
if (qu(1) < 0.0_pReal) qu = -qu
|
qu = (qu-0.5_pReal) * 2.0_pReal
|
||||||
q = qu
|
q = qu
|
||||||
|
|
||||||
q_2 = q + q
|
q_2 = q + q
|
||||||
|
|
Loading…
Reference in New Issue