From c1e5f66d777ac5dadb8bdf2025c92177d0812147 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 8 Dec 2018 13:03:27 +0100 Subject: [PATCH] make quaternion accesible output as usual array to completly hide the internal representation --- src/rotations.f90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rotations.f90 b/src/rotations.f90 index f9ec9cf74..539cc23c2 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -34,6 +34,7 @@ module rotations type, public :: rotation type(quaternion), private :: q contains + procedure, public :: asQuaternion procedure, public :: asEulerAngles procedure, public :: asAxisAnglePair procedure, public :: asRodriguesFrankVector @@ -76,6 +77,15 @@ type(rotation) function init(eu,ax,om,qu,cu,ho,ro) end function +function asQuaternion(this) + class(rotation), intent(in) :: this + real(pReal), dimension(4) :: asQuaternion + + asQuaternion = [this%q%w, this%q%x, this%q%y, this%q%z] + +end function asQuaternion + + function asEulerAngles(this) class(rotation), intent(in) :: this real(pReal), dimension(3) :: asEulerAngles