I have a strange problem with the Mod-function when used for transforming any angle \[Omega]
into the half-open interval [-\[Pi], \[Pi])
. This is done by Mod[\[Omega], 2 \[Pi], -\[Pi]]
:
Plot[Mod[\[Omega], 2 \[Pi], -\[Pi]], {\[Omega], -3 \[Pi], 3 \[Pi]}]
This transformation does not work without error at the bounds [Omega] = ..., -360°, -180°, 180°, 360°, ... Instead, we have to use:
If[ [Omega] == [Pi] Floor[N[ [Omega] / [Pi] ]], -[Pi], Mod[ [Omega] ,2 [Pi] , -[Pi] ] ]
For details, see this attached notebook "220109 Transforming an Angle.nb".
Note: This was done with Wolfram desktop version 13.0.0, but happens as well with version 12.3.1 and version 12.0.0 on Windows 10 Pro (64 bit).
Attachments: