make quaternion accesible

output as usual array to completly hide the internal representation
This commit is contained in:
Martin Diehl 2018-12-08 13:03:27 +01:00
parent 9686014ce0
commit c1e5f66d77
1 changed files with 10 additions and 0 deletions

View File

@ -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