I need to increase/reduce **phi** angle by value **d** infinitely. (**d** can be negative or positive).

"Infinitely" means that cycling change can happen as much as long. But to avoid overflowing it is necessary "drop" value, relying on periodicity of sin () and cos (). (0 <=> 2\*pi <=> 2\*n\*pi).

How it can be implemented in function? (e.g. double stepAngle(double phi, double d)).