From 1b595b4864a61b8c4f2c05a88523919590ea8775 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 7 Jun 2019 14:30:16 +0200 Subject: [PATCH] initialize from Eulers (common case) --- src/rotations.f90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rotations.f90 b/src/rotations.f90 index 3a64f27b9..5090261e6 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -65,6 +65,7 @@ module rotations procedure, public :: asRotationMatrix !------------------------------------------ procedure, public :: fromRotationMatrix + procedure, public :: fromEulerAngles !------------------------------------------ procedure, public :: rotVector procedure, public :: rotTensor @@ -143,7 +144,16 @@ subroutine fromRotationMatrix(self,om) self%q = om2qu(om) end subroutine +!--------------------------------------------------------------------------------------------------- +subroutine fromEulerAngles(self,eu) + class(rotation), intent(out) :: self + real(pReal), dimension(3), intent(in) :: eu + + self%q = eu2qu(eu) + +end subroutine +!--------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------- !> @author Marc De Graef, Carnegie Mellon University