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

So, for example:


I know such function exists in Matlab.

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


1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.