private GetAngleToTurn ( int fLeft, int iWidth, double percent ) : int | ||
fLeft | int | |
iWidth | int | |
percent | double | |
return | int |
private int GetAngleToTurn(int fLeft, int iWidth, double percent)
{
double a = iWidth * (0.5 - percent);
double h = iWidth / 2 - fLeft;
double alpha = Math.Acos(a / h);
int angleDegree = (int)(alpha * 360 / (2 * Math.PI));
return angleDegree;
}