Last active
April 26, 2018 00:29
-
-
Save JasonSpine/15e5ce563eceaf4612e115d34f06835c to your computer and use it in GitHub Desktop.
Unity C# Atan360 degrees
This file contains hidden or 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
public class MyMath { | |
float atan360(float y, float x) { | |
float result = Mathf.Atan2 (y, x) * Mathf.Rad2Deg; | |
if (result < 0.0f) { | |
return result + 360.0f; | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment