Solved by KFrank in post #2 
              
              
                Hi Zimo! 

Rather than outputting a single value that is your angle, I think it makes 
more geometric sense to output two values, x and y, on the ray that 
defines your angle.  Then regulate your x and y by pushing them 
towards (but not constraining them to lie on) the unit circle with a term 
like…