Build a half cardinal cyclic quine A half cardinal cyclic quine is a cyclic quine with two states, one perpendicular to the other.

Rules

You can decide which rotation you want to implement, clockwise or counter-clockwise.

Once rotated, any gaps in your code should be replaced with spaces to preserve the positioning.

Your program must satisfy the community definition of a quine.

This is code-golf so the shortest program in each language wins. Your first program is used for your byte count.

Standard loopholes are forbidden.

Examples

If your program is:

$_='print';eval


Then the next iteration must be either:

$
_
=
'
p
r
i
n
t
'
;
e
v
a
l


or

l
a
v
e
;
'
t
n
i
r
p
'
=
_
$


which must output the original program:

$_='print';eval


If your program is:

;$_=';
;$_=';
print


Then the next iteration must be either:

;;
''t
==n
__i
$$r
;;p


or:

p;;
r$$
i__
n==
t''
 ;;


which must output the original program:

;$_=';
;$_=';
print
CJam, 19 17 15 bytes

{s"_~"+N*""-}_~


Try it online! Try the rotation.

Explanation

{s"_~"+  e# Standard quine framework. Puts a string representation of the entire
         e# program on the stack.
  N*     e# Riffle linefeeds into the string, which is effectively a clockwise
         e# rotation by 90°.
  ""-    e# Does nothing.
}_~


In the rotated code, we've got linefeeds everywhere:

{
s
"
_
~
"
+
N
*
"
"
-
}
_
~


As Lynn noticed on Dom's earlier quine challenge inserting linefeeds actually still forms valid quine, because the linefeeds inside the block will just be retained verbatim anyway, and there will also be linefeeds in the "_~" string to make those two characters at the end show up on their own line. So {s"_~"+...}_~ (with linefeeds) is still a valid quine framework (although there'll be an additional linefeed at the end of the string). N* now inserts even more linefeeds into that string, but we don't really care: because now ""- has a linefeed inside that string so it actually removes all linefeeds from the program representation. So we end up with the horizontal form of the code again, undoing the rotation.