make quaternion accesible
output as usual array to completly hide the internal representation
This commit is contained in:
parent
9686014ce0
commit
c1e5f66d77
|
@ -34,6 +34,7 @@ module rotations
|
||||||
type, public :: rotation
|
type, public :: rotation
|
||||||
type(quaternion), private :: q
|
type(quaternion), private :: q
|
||||||
contains
|
contains
|
||||||
|
procedure, public :: asQuaternion
|
||||||
procedure, public :: asEulerAngles
|
procedure, public :: asEulerAngles
|
||||||
procedure, public :: asAxisAnglePair
|
procedure, public :: asAxisAnglePair
|
||||||
procedure, public :: asRodriguesFrankVector
|
procedure, public :: asRodriguesFrankVector
|
||||||
|
@ -76,6 +77,15 @@ type(rotation) function init(eu,ax,om,qu,cu,ho,ro)
|
||||||
|
|
||||||
end function
|
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)
|
function asEulerAngles(this)
|
||||||
class(rotation), intent(in) :: this
|
class(rotation), intent(in) :: this
|
||||||
real(pReal), dimension(3) :: asEulerAngles
|
real(pReal), dimension(3) :: asEulerAngles
|
||||||
|
|
Loading…
Reference in New Issue