0
$\begingroup$

I have an arc with a given center, start angle, end angle, and radius.

I want to draw an arrow showing the arc direction in the arc middle point. What is the easiest way to calculate this direction (it does not need to be precise, it's only a representation issue)?

I've found the arc middle point so far.

My only idea is to find a point very close to the middle point with the direction the arc has. Then, take the direction of the line connecting these two points and draw an arc to this line. Unfortunately, this needs much computation, and as I want to use it in a C++ application I'm looking for better way of determining arrow vector direction.

$\endgroup$
4
  • 1
    $\begingroup$ Do you mean the direction of the tangent to the arc middle point? If so, it is orthogonal to the direction given by $(\theta_1+\theta_2)/2$. $\endgroup$ – enzotib Jul 31 '12 at 12:09
  • $\begingroup$ Ok I see. What is your /theta? Please make answer. $\endgroup$ – krzych Jul 31 '12 at 12:13
  • $\begingroup$ simply add $\pi/2$ $\endgroup$ – enzotib Jul 31 '12 at 12:14
  • $\begingroup$ Sorry dont get it? To what I should add pi/2 $\endgroup$ – krzych Jul 31 '12 at 12:15
1
$\begingroup$

The middle point of the arc given by $$(x,y)=(x_0,y_0)+r(\cos t,\sin t),\qquad t\in[\theta_1,\theta_2] $$ is relative to the value of $t$ given by $t=(\theta_1+\theta_2)/2$, and the direction of the tangent is obtained adding $\pi/2$ (modulo $\pi$ if you don't care about the versus): $$t=\frac{1}{2}(\theta_1+\theta_2+\pi).$$

$\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.