Skip to content

Instantly share code, notes, and snippets.

@estebanpadilla
Created August 31, 2013 22:45
Show Gist options
  • Save estebanpadilla/6401133 to your computer and use it in GitHub Desktop.
Save estebanpadilla/6401133 to your computer and use it in GitHub Desktop.
Some methods to get positions using angle and radius.
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