I imagine that this is a simple question, but I\'m getting some strange results with my current code and I don\'t have the math background to fully understand why. My goal
Firstly, since you're in radians it's probably beneficial to define your angle as such:
double angle = (Math.PI / 3); // 60 degrees...
The functions themselves are working fine. The rounding will only affect your answer if your distance is sufficiently small enough. Other than that, the answers should come out just fine.
If it's the rounding you're worried about, remember that by default, .NET does banker's rounding, and you may want:
result.X = (int)Math.Round(centerPoint.X + distance * Math.Cos(angle), MidpointRounding.AwayFromZero);
result.Y = (int)Math.Round(centerPoint.Y + distance * Math.Sin(angle), MidpointRounding.AwayFromZero);
instead.
Additionally, in the question you want distance X and angle Y... I assume you're not relating that to the point (X,Y), because that's completely different.
The distance formula is:
double distance = Math.Sqrt((centerPoint.X + result.X)^2 + (centerPoint.Y + result.Y)^2);