I use this formula to calculate the angle on an ellipse
Phi = atan(y*py/x*px)
, where py
and px
are parameters of an ellipse. When the animation crosses -PI and PI, it changes its direction by PI rad.
I use RxJs and don't know how to make a swap at right time. Maybe I need to subscribe to some event?
arrows showing the orientation of the object that I get, its moving in clockwise direction