clockwise_rotation Function

private function clockwise_rotation(x, t)

Arguments

Type IntentOptional AttributesName
real(kind=rp), intent(in), DIMENSION(2):: x
real(kind=rp), intent(in) :: t

Return Value real(kind=rp), DIMENSION(2)


Contents

Source Code


Source Code

  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