Skip to content

Instantly share code, notes, and snippets.

@JasonSpine
Last active April 26, 2018 00:29
Show Gist options
  • Save JasonSpine/15e5ce563eceaf4612e115d34f06835c to your computer and use it in GitHub Desktop.
Save JasonSpine/15e5ce563eceaf4612e115d34f06835c to your computer and use it in GitHub Desktop.
Unity C# Atan360 degrees
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