I'm trying something that I thought should be reasonably simple. I have an angle, a position and a distance and I want to find the X,Y co-ordinates from this information.
With an example input of 90 degrees I convert the value to radians with the following code:
public double DegreeToRadian(float angle)
{
return Math.PI * angle / 180.0;
}
This gives me 1.5707963267949 radians
Then when I use
Math.Cos(radians)
I end up with an an answer of: 6.12303176911189E-17
What the heck is going on? The cosine of 90 degrees should be 0, so why am I getting such a deviance... and more importantly how can I stop it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…