Created
August 31, 2013 22:45
-
-
Save estebanpadilla/6401133 to your computer and use it in GitHub Desktop.
Some methods to get positions using angle and radius.
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
private float Sine(float angle){ | |
float sin = Mathf.Sin((Mathf.PI / 180)* angle); | |
return sin; | |
} | |
private float Cosine(float angle){ | |
float cosine = Mathf.Cos((Mathf.PI / 180) * angle); | |
return cosine; | |
} | |
private float GetXPosWithAngleAndRadius(float angle, float radius){ | |
float xpos = Sine(angle) * radius; | |
return xpos; | |
} | |
private float GetYPosWithAngleAndRadius(float angle, float radius){ | |
float xpos = Cosine(angle) * radius; | |
return xpos; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment