Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rp), | intent(in), | DIMENSION(2) | :: | x | ||
real(kind=rp), | intent(in) | :: | t |
FUNCTION clockwise_rotation(x,t)
IMPLICIT NONE
REAL(rp), DIMENSION(2), INTENT(IN) :: x
REAL(rp), INTENT(IN) :: t ! Angle in radians
REAL(rp), DIMENSION(2) :: clockwise_rotation
clockwise_rotation(1) = x(1)*COS(t) + x(2)*SIN(t)
clockwise_rotation(2) = -x(1)*SIN(t) + x(2)*COS(t)
END FUNCTION clockwise_rotation