Find the point on a circle with given center point, radius, and degree

You should post the code you are using. That would help identify the problem exactly.

However, since you mentioned measuring your angle in terms of -360 to 360, you are probably using the incorrect units for your math library. Most implementations of trigonometry functions use radians for their input. And if you use degrees instead...your answers will be weirdly wrong.

x_oncircle = x_origin + 200 * cos (degrees * pi / 180)
y_oncircle = y_origin + 200 * sin (degrees * pi / 180)

Note that you might also run into circumstance where the quadrant is not what you'd expect. This can fixed by carefully selecting where angle zero is, or by manually checking the quadrant you expect and applying your own signs to the result values.


The simple equations from your link give the X and Y coordinates of the point on the circle relative to the center of the circle.

X = r * cosine(angle)  
Y = r * sine(angle)

This tells you how far the point is offset from the center of the circle. Since you have the coordinates of the center (Cx, Cy), simply add the calculated offset.

The coordinates of the point on the circle are:

X = Cx + (r * cosine(angle))  
Y = Cy + (r * sine(angle))

I highly suggest using matrices for this type of manipulations. It is the most generic approach, see example below:

// The center point of rotation
var centerPoint = new Point(0, 0);
// Factory method creating the matrix                                        
var matrix = new RotateTransform(angleInDegrees, centerPoint.X, centerPoint.Y).Value;
// The point to rotate
var point = new Point(100, 0);
// Applying the transform that results in a rotated point                                      
Point rotated = Point.Multiply(point, matrix); 
  • Side note, the convention is to measure the angle counter clockwise starting form (positive) X-axis

Tags:

C#

Geometry