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.

  • 0
    Sorry dont get it? To what I should add pi/22012-07-31

1 Answers 1

1

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