0
$\begingroup$

How can I calculate the angle at the center of an arc knowing radius and center, start, and end points? I know how to do that if I have the length of the arc, but in my case I don't have it.

$\endgroup$
  • $\begingroup$ You also need to know the direction in which the arc is traced. There are two arcs with the same start and end points. $\endgroup$ – amd Apr 1 at 19:16
0
$\begingroup$

Vectors to the rescue!

I assume you're dealing with two dimensions. Let's say the center is $(x_c, y_c)$ and the end points are $(x_1, y_1)$ and $(x_2, y_2)$.

Transform the coordinates so that the center coincides with the origin, and we're dealing with position vectors. The vectors for the end points are $\begin{pmatrix} x_1 - x_c \\ y_1 - y_c \end{pmatrix}$ and $\begin{pmatrix} x_2 - x_c \\ y_2 - y_c \end{pmatrix}$.

The dot product of these two is $(x_1-x_c)(x_2-x_c) + (y_1 - y_c)(y_2 - y_c)$. It is also equal to the product of their magnitudes multiplied by the cosine of the angle between the vectors, which is also the central arc angle you want.

So $(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}\cdot \sqrt{(x_2-x_c)^2 + (y_2 - y_c)^2} \cdot \cos \theta$

This allows you to solve for $\theta$.

As per the comments below, be careful about whether you wish to compute the central angle of the minor arc or the major arc. It's quite trivial going from one to the other.

$\endgroup$
  • $\begingroup$ Thank you very much $\endgroup$ – Mazin Apr 1 at 11:20
  • $\begingroup$ There are two arcs with these end points. How do you know which one was meant? $\endgroup$ – amd Apr 1 at 19:18
  • $\begingroup$ @amd That's just minor vs major arc, and it's quite easy to decide because the former angle is less than $\pi$ while the latter is greater (boundary case of semicircular arc when the angle is equal to $\pi$). To go from one to the other, the OP can just take $2\pi - \theta$. I don't think this is an insurmountable problem. $\endgroup$ – Deepak Apr 1 at 23:59
  • $\begingroup$ And what did you base this arbitrary decision on? The problem as stated is underspecified. I agree that it’s a minor issue, but it underscores a tacit assumption that you’ve made in this answer. $\endgroup$ – amd Apr 2 at 0:45
  • $\begingroup$ @amd I believe with your comment and mine, the OP already has ample information to decide what he/she wants. There is nothing more to be said. But in any case, I've edited my answer with a brief note. $\endgroup$ – Deepak Apr 2 at 1:44
0
$\begingroup$

Hint: try to compute the length of the arc from the data you have.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.