2
$\begingroup$

How to draw a directed arc with an initial point $(x_i,y_i)$, a terminal point $(x_t,y_t)$, and another given, intermediate point $(x_m,y_m)$ on the arc (say in the middle of the arc)? For instance, we may have $(x_i,y_i)=(0,0)$, $(x_t,y_t)=(2,0)$, and $(x_m,y_m)=(1,1/3)$.

I have noticed the nice answers to a related problem. However, with my very limited proficiency in Mathematica, I do not see a good way to modify those answers to get what I need here. I can certainly draw an arc -- but how to attach an arrow to it nicely?

$\endgroup$
7
  • $\begingroup$ The documentation for Arrow gives examples of how to use Bezier curves to describe the path of an arrow, or a list of points. I expect you could create a function to draw a directed arc based on one or other of those. No Mathematica on this machine or I might have experimented a wee bit myself. $\endgroup$ Jan 14 at 14:49
  • $\begingroup$ @HighPerformanceMark : Thank you very much for your hint. $\endgroup$ Jan 14 at 14:57
  • $\begingroup$ pts = {{0, 0}, {2, 0}, {1, 1/3}}; and Graphics[Arrow[BezierCurve[pts]]]. $\endgroup$
    – Syed
    Jan 14 at 14:58
  • $\begingroup$ @Syed : Thank you very much. Can you post this as an answer, so that I could accept it? $\endgroup$ Jan 14 at 15:04
  • $\begingroup$ It is directly from the docs. If you make the question more interesting, then I would be happy to try to solve it and post an answer. $\endgroup$
    – Syed
    Jan 14 at 15:07
2
$\begingroup$

With the hint from HighPerformanceMark, the answer is simple. For instance,

Graphics[{Arrowheads[.06],Arrow[BezierCurve[{{0,0},{1,1},{2,0}}]]}]

yields

enter image description here

$\endgroup$
2
  • $\begingroup$ But this is not a circle arc. Compare with pts = {{0, 0}, {1, 1/3}, {2, 0}}; Graphics[{Circumsphere[pts], Point[pts], Red, {Arrowheads[.06], Arrow[BezierCurve[{{0, 0}, {1, 1}, {2, 0}}]]}}] $\endgroup$
    – cvgmt
    Jan 14 at 15:08
  • $\begingroup$ @cvgmt : Thank you for your comment. Of course, you are right. However, I am as happy with the Besier version, if not more -- because Besier curves seem more elegant to me than circular arcs. $\endgroup$ Jan 14 at 15:26

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.