Calculate pi of a radian that can be negative or positive?

88 Views Asked by At

I have a variable A which is a radian angle value. I also have a variable B that should always be PI away from A. How can I verify that B is PI off of A with 0.01 accuracy in negative or positive direction (C++)? A's value can be negative.

1

There are 1 best solutions below

0
hedeic On

Peter's answer in the comments suited well to this problem: std::abs(std::abs(a - b) - pi) <= 0.01