Finding the coordinates on the edge of a circle

c#, geometry, math, trigonometry

Solution

Here's the mathematical solution which can be applied in any language:

x = x0 + r * cos(theta)
y = y0 + r * sin(theta)

`x0` and `y0` are the coordinates of the centre, `r` is the radius, and `theta` is in radians. The angle is measured anticlockwise from the x-axis.

This is the code for C# specifically if your angle is in degrees:

double x = x0 + r * Math.Cos(theta * Math.PI / 180);
double y = y0 + r * Math.Sin(theta * Math.PI / 180);

Problem

Using C#: How do I get the (x, y) coordinates on the edge of a circle for any given degree, if I have the center coordinates and the radius? There is probably SIN, TAN, COSIN and other grade ten math involved... :)

Original source

Related problems