tan@=(M1-M2)/(1+M1M2), remember to absolute the expression on the right.
But in our case we want the obtuse so we dont necessarily need to take the absolute, and yea...if your angle you found is obtuse then just leave it, dont minus it from 180...other than that i dont know whats wrong...