Last active
October 31, 2018 02:38
-
-
Save alifahrri/2d9996164f0598836153e854c431057a to your computer and use it in GitHub Desktop.
py code for wrapping around an angle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def norm_angle(dw) : | |
if math.fabs(dw) > math.pi : | |
return (-2*math.pi + dw) if dw > 0 else (2*math.pi + dw) | |
else : return dw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment