I'm implementing 3D rotations for a set of 3D circles. To do that I'm using the parametric equation as described in http://demonstrations.wolfram.com/ParametricEquationOfACircleIn3D/.
It works as expected, but I can't figure out how to mitigate one issue. That is every $180$ degrees my circle flips.
I calculate the normal vector for every circle using $arctan()$. It's value starts from $-0$ then goes to $-\frac{\Pi}{2}$. But then it goes to $\frac{\Pi}{2}$ and decrements down to $-\frac{\Pi}{2}$. And the cycle continues.
How do I make this a continuous progression?
I need this to stop my vertices from flipping.
If you are using atan() function, replace it by atan2(). atan2() is always favorable than atan(). Please note that atan2() takes two arguments: y value and x value.