Calculate Coordinates of a circle

1.2k Views Asked by At

I have an image where I need to plot an ROI every 45 degrees around a circle. Here is what I know:

  1. The center of the circle is the same as the center of the image with coordinates (90,90).
  2. I also know the coordinates of the first point on the circle which is (32,92).
  3. The radius of this circle is 61.
  4. The angle between each point on the circle needs to be 45 degrees.
  5. The calculation starts at the first known coordinate and goes clockwise around the circle giving the coordinates of a point on the circle every 45 degrees.

The following picture illustrates my set up and the (x,y) coordinates are the points that the formula needs to determine.

So my question is, what is the formula that will give me the (x,y) coordinates around this circle?

enter image description here

1

There are 1 best solutions below

0
On

To rotate the point $(32,92)$ clockwise by $45º$, we can use the rotation formula:

$$x' = x \cos \theta - y \sin \theta$$ $$y' = x \sin \theta + y \cos \theta$$

This formula rotates any point around the origin anti-clockwise. $(x,y)$ is the original point, $(x', y')$ is the transformed point, and $\theta$ is the rotation angle. The reason for this formula lies in matrices, which is incredibly useful in the real world.

In this case, $\theta = -45º$ because $\theta$ is the angle when rotated anti-clockwise (this is a standard convention in mathematics), so making the angle negative will rotate the point clockwise.

This simplifies to:

$$x' = \frac{1}{\sqrt 2} x + \frac{1}{\sqrt 2} y$$ $$y' = -\frac{1}{\sqrt 2} x + \frac{1}{\sqrt 2} y$$

and when your point is $(32, 92)$: $$x' = \frac{1}{\sqrt 2} (32) + \frac{1}{\sqrt 2} (92) = 87.7 \ \text{(3 s.f)}$$ $$y' = -\frac{1}{\sqrt 2} x + \frac{1}{\sqrt 2} y = 42.2 \ \text{(3 s.f)}$$

Now your centre is actually $(90,90)$, so if you transform the point $(x', y')$ $90$ units right and $90$ units up, you get $(177.7, 132.2)$ approximately.

You can repeat this process for the other angles.


Sidenote: There are actually other ways to do this, including using complex numbers. You can use your original idea of using basic trigonometry, but since the line connecting your point and the centre is not horizontal, you would need to first find the angle with the horizontal, then use $x = r \cos \theta, y = r \sin \theta$.