From aefd401e8cdda0ad4164f09728595f4c2467d7b1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 11 Jan 2020 03:11:45 +0100 Subject: [PATCH] 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 --- src/quaternions.f90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/quaternions.f90 b/src/quaternions.f90 index 3df230e31..9a14fa211 100644 --- a/src/quaternions.f90 +++ b/src/quaternions.f90 @@ -435,7 +435,6 @@ pure function asArray(self) class(quaternion), intent(in) :: self asArray = [self%w,self%x,self%y,self%z] - if (self%w < 0) asArray = -asArray end function asArray @@ -475,7 +474,7 @@ subroutine unitTest type(quaternion) :: q, q_2 call random_number(qu) - if (qu(1) < 0.0_pReal) qu = -qu + qu = (qu-0.5_pReal) * 2.0_pReal q = qu q_2 = q + q