How to calculate opposite direction angle
If you are given an angle $\alpha$, the oppossite angle would be $\alpha+180$. If you need to remain in $[0,360]$ then, you should take $(\alpha+180)\ mod\ 360$ (what in this case it is simply taking $\alpha-180$ if $\alpha+180\ge360$)