# How to calculate the distance between two points on a circle in degrees [closed]

I've been trying to figure this out for several hours now and am having trouble finding the right solution.

Given two points on a circle and the radius of the circle I need to calculate the distance in degrees between the two points on the circle. Here's a picture of what I'm trying to do.

In this picture I have a point at (-12.2,12.7) which represents the center of the circle. I know the radius of the circle (5.344) and I have two points on the circle. One at (-12.4,7.4) and another at (-17, 13.7). I need to get the length of the arc in degrees. I know if I have the center angle I can calculate the arc length, but I can't find anything about how to determine the center angle without already knowing the arc length.

Any help much appreciated.

EDIT

Updating the image to use real values

## closed as unclear what you're asking by Ian Miller, JonMark Perry, MJD, Claude Leibovici, WatsonMay 22 '16 at 7:54

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Hint: unit circle. – user223391 May 22 '16 at 5:42
• Suppose the angle is $\theta$. Looking at the $y$-coordinate, you have $\cos\theta=0.5$. So $\theta=60^o$. – almagest May 22 '16 at 5:44
• I'm not convinced that $\ (0.7, \ 0.5) \$ is one unit away from the origin. Are all of your coordinates correct? – colormegone May 22 '16 at 6:24
• @omatase Call $C$ the centre of the circle, $P$ the point $(.7,.5)$ and $Q$ the point $(0,0.5)$. Then $CPQ$ is a right-angled triangle. Do you remember basic trigonometry. The cosine of $\angle POQ$ is adjacent/hypotenuse = $OQ/OP=0.5/1$. – almagest May 22 '16 at 6:25
• @RecklessReckoner Yes, either the point is $(0.8660,0.5)$ or $(0.7,0.7141)$ or something entirely different! – almagest May 22 '16 at 6:27

If the included angle is $\theta$ and the radius is $r$ then $$s= r \theta$$

To find the included angle $\theta$ subtract the two orientation angles you get from an $\arctan(y/x)$ operation

$$\theta = \arctan\left( \frac{y_2}{x_2} \right) -\arctan\left( \frac{y_1}{x_1} \right)$$

NOTES: You might need to use the ATAN2(dy,dx) function to resolve angles in all the quadrants

• so given two points (0,5) and (5,0) θ would be 0. What am I missing here? – omatase May 23 '16 at 4:52
• Since both points are in the first quadrant $\arctan \left( \frac{5}{0} \right) = \frac{\pi}{2}$ and $\arctan \left( \frac{0}{5} \right) = 0$ (see en.wikipedia.org/wiki/Atan2) – ja72 May 23 '16 at 5:40

Updated to take into account your change of question

(Actually - ignoring your diagram and using my own)

Applying dot product of the two vectors you get:

$$\cos\theta=\frac{(x_1-x_c)(x_2-x_c)+(y_1-y_c)(y_2-y_c)}{\sqrt{(x_1-x_c)^2+(y_1-y_c)^2}\times\sqrt{(x_2-x_c)^2+(y_2-y_c)^2}}$$

so that

$$\theta=\cos^{-1}\left(\frac{(x_1-x_c)(x_2-x_c)+(y_1-y_c)(y_2-y_c)}{\sqrt{(x_1-x_c)^2+(y_1-y_c)^2}\times\sqrt{(x_2-x_c)^2+(y_2-y_c)^2}}\right)$$

Note: The bottoms of these fraction is just the radius times radius of your circle. However your shapes so far have not been circles so this is a general formula that will give you the angle between any two random points compared to a center point.

• Cosine in the fourth quadrant is the same as cosine in the first... – DJohnM May 22 '16 at 18:12
• If I use this method plugging in some generic numbers (0,5) and (5,0) I get 90 degrees which is correct, but when I plug in the numbers in my image (-12.4, 17) and (7.4, 13.7) I get some weird results 180. - 308.728 I. See here: wolframalpha.com/input/?i=inverse+cosine+of+((-12.4*17)+%2B+(7.4*13.7)). What am I doing wrong? – omatase May 23 '16 at 5:43
• "Whats wrong?" - you changed the question. Before you had a radius of one. I'll update my answer to match your new version of the question. – Ian Miller May 23 '16 at 12:46
• @DJohnM Thanks. Removed unnecessary (and wrong) statement about quadrants. – Ian Miller May 23 '16 at 13:04
• Aaaaah! Now I see why there were so many problems with my original image. It was just supposed to be an example of a possible set of numbers, it wasn't ever supposed to mean that the radius will always be 1. In the real world when I use this equation to solve the problem, although the radius will be known, it will not always be the same between circles (same with the other points). – omatase May 24 '16 at 2:19

The diagram showing the center at $(0,0)$ is inconsistent with the other points in the diagram, and with the stated form of the problem. So:

Edit: The edited question confirms the assumptions of this solution.

Given two points on a circle and the radius $R$, first calculate the distance $D$ between the two given points, the chord between the two points:$$D=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$$

Half this length, $\frac D2$, along with the radius form one side and the hypotenuse of a right-angle triangle. So, the angle at the centre, $\theta$ subtended by the entire chord, is given by:$$\theta=2\times \arcsin \left(\frac{D}{2R} \right)$$

A slightly more complex method is to use the Law of Cosines. With $R$ given, and $D$ calculated:$$\cos({\theta)}=\frac{R^2+R^2-D^2}{2R^2}$$

• It sounds like this will give me the center angle, but then how do I get the length of the arc? – omatase May 22 '16 at 23:32
• @omatase You didn't ask for the length of the arc. You asked for the distance in degrees. – Ian Miller May 23 '16 at 13:06
• @IanMiller Sorry, I'm struggling to use the right terms here. To me there's no difference in meaning between "distance between two points on the circle" and "length of the arc". Degrees or radians or whatever is fine but degrees is what I understand the best. – omatase May 24 '16 at 2:24