Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | rot_angle |
function rot_matrix(rot_angle) result(mat)
real(dp), intent(in) :: rot_angle
real(dp) :: mat(2, 2)
real(dp) :: angle
angle = rot_angle * pi / 180.0
mat = reshape([cos(angle), sin(angle), -sin(angle), cos(angle)], [2, 2])
! mat(1,1) = cos(angle)
! mat(1,2) = -sin(angle)
! mat(2,1) = sin(angle)
! mat(2,2) = cos(angle)
end function rot_matrix