rotation in the z-axis function from here
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | angle |
Angle to rotate by |
function rotate_z(angle) result(r) !! rotation in the z-axis function from [here](https://inspirnathan.com/posts/54-shadertoy-tutorial-part-8/) use utils, only : deg2rad !> Angle to rotate by real(kind=wp), intent(IN) :: angle real(kind=wp) :: r(4, 4), c, s, a a = deg2rad(angle) c = cos(a) s = sin(a) r(:, 1) = [c, -s, 0._wp, 0._wp] r(:, 2) = [s, c, 0._wp, 0._wp] r(:, 3) = [0._wp, 0._wp, 1._wp, 0._wp] r(:, 4) = [0._wp, 0._wp, 0._wp, 1._wp] end function rotate_z