Orthogonal Orientation Task: Given an input consisting of exactly one of the characters &lt;&gt;^v, output a second input consisting of the printable ASCII characters (from space to tilde), oriented with the arrow.

Let's assume the second input to the program is ABC. This is what it should do:


Input &gt;: print ABC.
Input &lt;: print CBA.
Input ^: print C\nB\nA, or the input rotated -90&deg;.
Input v: print A\nB\nC, or the input rotated 90&deg;.


Test cases

input =&gt; \n output
---
"&gt;", "thanks!" =&gt;
thanks!
---
"&lt;", "Hello, World!" =&gt;
!dlroW ,olleH
---
"^", "This is text." =&gt;
.
t
x
e
t

s
i

s
i
h
T
---
"v", "Tokyo" =&gt;
T
o
k
y
o
---
"&lt;", "&gt;&gt;&gt;" =&gt;
&gt;&gt;&gt;


This is a code-golf, so the shortest program in bytes wins.
MATL, 10 6 bytes

4 bytes saved thanks to Martin!

19\qX!


Try it online!

19\            % implicitly take input (a character) and compute mod-19 of its ASCII code
   q           % subtract 1. Gives 17, 2, 3, 4 for the characters '^&lt;v&gt;' respectively.
               % These numbers correspond to 1, 2, 3, 4 modulo 4, and so are the numbers
               % of 90-degree rotations required by each character
    X!         % implicitly take input (string). Rotate the computed number of times
               % in steps of 90 degrees. Implicitly display




Old version, without modulo operations: 10 bytes

'^&lt;v&gt;'=fX!


Try it online!

'^&lt;v&gt;'         % push string
      =        % implicitly take input (a char) and test for equality
       f       % find index of matching character
        X!     % implicitly take input (string). Rotate that number of times
               % in steps of 90 degrees. Implicitly display