rotate_vec Function

public function rotate_vec(in_vec, rot_angle) result(out_vec)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: in_vec(3)
real(kind=dp), intent(in) :: rot_angle

Return Value integer, (3)


Contents

Source Code


Source Code

    function rotate_vec(in_vec, rot_angle) result(out_vec)
        integer, intent(in) :: in_vec(3)
        real(dp), intent(in) :: rot_angle
        integer :: out_vec(3)

        ! apply the actual rotation to the vector..
        out_vec(1:2) = nint(matmul(rot_matrix(rot_angle), real(in_vec(1:2))))
        out_vec(3) = in_vec(3)

    end function rotate_vec