4

Is there any built-in Mathematica function that wraps any angle in rad to the $[0,2\pi]$ domain?

So, for example:

wrapTo2pi[9Pi/4]=Pi/4

I know such function exists in Matlab.

Extend: how to wrap any number to a given domain? like wrap A into $[B,C]$

AJHC
  • 369
  • 1
  • 8

1 Answers1

9
wrapTo2pi[x_] := Mod[x, 2 Pi]
wrapTo2pi[9 Pi/4]