How to get inverted angle of the pawn?

It blows my mind, I can’t beat it more than an hour
So, I want to define the moment when my pawn’s back is oriented to some point around.
It works only in the case when this point behind the pawn is located from the right side, but it doesn’t work for the left side.
If I’m using -180 then it becomes work for the left side and it doesn’t work for the right side

Hopefully, I’ve found the right answer