How do I calculate P->Q: an Arc of a circle?

90 Views Asked by At

How do I calculate the arc of a circle in radions?

Hi there! It has been many years since I have brushed up on my trigonometry skills, and I am trying to solve this particular equation for my program at work.

Here is the picture I drew of the problem

  • The radius of the Big circle is known: R1
  • The radius of the small circle is known: R2
  • The the x, y coordinates of point P is known
  • The the x, y coordinates of point P2 is known
  • The the x, y coordinates of point P3 is known
  • The the x, y coordinates of point Q is unknown

What I actually want to solve

I want to know what is the distance in radians following the the arc of the big circle from point P to Q? Could someone please show me how to solve this step by step, explaining each of the steps as they go?

If I need to be clearer explaining the problem or give more information, I will happily provide it.

Thanks so much in advance!

1

There are 1 best solutions below

3
On BEST ANSWER

Let $C$ be the center of the small circle. Its $x$ coordinate must be $x_{P3}+r_2$.

Its $y$ coordinate is such that the distance $P_2C$ is $r_1-r_2$. So you can write down an equation for it: $$ (x_{P3}+r_2-x_{P2})^2 + (y_C-y_{P2})^2 = (r_1-r_2)^2 $$ which is easy enough solve for $y_C$: $$ y_C = y_{P2} + \sqrt{(r_1-r_2)^2-(x_{P3}+r_2-x_{P2})^2} $$

Now that you know the coordinates of $C$ you can compute the direction from $P_2$ to $C$ (which is also the direction from $P_2$ to $Q$) by a single atan2 operation.

You can also compute the direction from $P_2$ to $P$ by atan2.

The difference between those direction is the central angle between $P$ and $Q$.