# How do you find an angle between two points on the edge of a circle?

I have two points on the circumference of circle and I also know the center of the circle. I want to calculate the angle between those two points which are on the circumference of circle.

Is this formula is suitable to this situation?

$$\tan(\theta) = \frac{y_2-y_1}{x_2-x_1}$$

where $(x_1,y_1)$ are the one of the circumference point $(x_2,y_2)$ is the other point on the circumference.

-
Well, you should shift your circle first so that it's centered at the origin, before you can use the formula for the tangent of the difference of two angles... – J. M. Aug 23 '12 at 11:44

The two points along with the center of the circle form an isosceles triangle. Two sides are radii of the circle. The base of the triangle is a line segment connecting the two points. Bisect the base with a line segment from the base to the center of the circle. Now we have two triangles, each with hypotenuse being a radius of the circle and the base being half the distance between the two points. The angle is half the angle that we want. sine of the half angle is the opposite side of the triangle (half the distance between the two points) over the hypotenuse (radius of the circle). The solution is then

angle = 2 x arcsin (0.5 x |P1 - P2| / radius)

-

You have an isosceles triangle.

You can use cosine formula for calculation the angle.

$$c^2 = a^2 + b^2 -2ab \cos(\alpha)$$

$a$ and $b$ are sides next to the angle $\alpha$, which are the radius of the center $r$. $c$ is the distance between the two points $P_1$ and $P_2$. So we get:

$$\left|P_1 - P_2\right|^2 = 2r^2-2r^2 \cos(\alpha)$$

$$\frac{2r^2-\left|P_1 - P_2\right|^2}{2r^2} = \cos(\alpha)$$

$$\alpha = \cos^{-1}\left(\frac{2r^2-\left|P_1 - P_2\right|^2}{2r^2}\right)$$

-
I'm having a hard time understanding what is meant by |P1 - P2|^2. Could you elaborate? – WebWanderer Feb 27 '15 at 17:18
@WebWanderer $|P1 - P2|$ is the distance between the 2 points $P1$ and $P2$. You calculate the distance by subtracting the points and calculate the length of the resulting vector. E.g. if the two points are $\left(\frac{1}{2}\right)$ and $\left(\frac{3}{2}\right)$, the distance is $\left|\left(\frac{1}{2}\right) - \left(\frac{3}{2}\right) \right| = \left|\left(\frac{-2}{0}\right) \right| = \sqrt((-2)^2 + 0^2) = \sqrt{4} = 2$. – user38034 Feb 27 '15 at 17:30
Ah, ok. Thanks! – WebWanderer Feb 27 '15 at 17:31