title: Calculating point on a circle's circumference from angle in C#?
body: <p>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 is simple, as stated in the title: I just want to find the point at some distance and angle from a center point.</p>
  
  <p>My current code:</p>
  
  <pre><code>Point centerPoint = new Point ( 0, 0 );
  Point result      = new Point ( 0, 0 );
  double angle      = 0.5; //between 0 and 2 * PI, angle is in radians
  int distance      = 1000;
  
  result.Y = centerPoint.Y + (int)Math.Round( distance * Math.Sin( angle ) );
  result.X = centerPoint.X + (int)Math.Round( distance * Math.Cos( angle ) );
  </code></pre>
  
  <p>In general, this seems to work fairly reasonably, but I get problems at various spots, most notably when the angle corresponds to points in the negative x and y axis.  Clearly I'm doing something wrong -- thoughts on what that is?</p>
  
  <p>UPDATE:  This was my mistake, this code works fine -- the few outliers that were not working were actually due to a bug in how the angle for 1.5PI was being calculated.  I thought I had checked that well enough, but evidently had not.  Thanks to everyone for their time, hopefully the working code above will prove helpful to someone else.</p>