PowerShell, 84 bytes
This is going to be complete gibberish to people not familiar with PowerShell. Let's go through it.
param([char]$a,$b), with an explicit cast to character for
$a. The rest of the program is one statement. We'll start with the first half, up to the
We're creating a new dynamic array
(...,...) and indexing into it with
$a%7-eq6. The ASCII values for
62, respectively, and
116%7 = 62%7 = 6, and those are the two directions that "increase" down and to the right. So, if that
$true, we'll take the second value, which is
$b[0..$c], or an array of the characters of
$b up to the end. We get the value
$c from the first value,
$b[($c=$b.length)..0], which gets selected if the input char is
< (i.e., so it goes through the string backwards). Important to note is that even if the second value is selected, the
$c value is still calculated and stored, so we can re-use it as a shortcut like this.
So, we've now got an array of characters either going forwards or backwards. We then
-join those characters together with the result of another dynamic array index. This time we're selecting based on whether the ASCII value for
$a is below
90 (really lots of values would work, I selected this one just because). Since
< both have a value below
$false, so we select the empty string
"", and thus the char-array is simply concatenated. Otherwise, we select the newline character
"`n" to join the char-array together with newlines.
This resultant string is left on the pipeline, and output is implicit.
PS C:\Tools\Scripts\golfing> .\orthogonal-orientation.ps1 "^" "TimmyD"