# Arrow at the end of a parametric plot

Posted 7 years ago
9246 Views
|
6 Replies
|
2 Total Likes
|
 I would like to add an arrowhead to the end of the parametric plot: ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 1}] Is there an option to ParametricPlot to do this? I could not find it. If there is no option, can you please suggest a way to do this? Answer
6 Replies
Sort By:
Posted 7 years ago
 Check with In:= FullForm[ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 1}]] where the function data are and draw an arrow there In:= Graphics[Arrow[ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 1}][[1, 1, 3, 2]]], Axes -> True]  Answer
Posted 7 years ago
 Thank you, this worked to some extent, but not in all the cases I need it. For example in Graphics[Arrow[ParametricPlot[{Cos[t], Sin[t]}, {t, 0, -1}][[1, 1, 3, 2]]], Axes -> True] the arrow goes to the wrong end of the curve. It goes to the end corresponding to t=0, not to t=-1. Is there some place I can look up a documentation how the FullForm of ParametricPlot is generated? Answer
Posted 7 years ago
 Then one uses Arrowheads[] In:= Graphics[{Arrowheads[{-.1, 0}], Arrow[ParametricPlot[{Cos[t], Sin[t]}, {t, 0, -1}][[1, 1, 3, 2]]]}, Axes -> True] or even better does a function headEnd[] to generate {-.1, 0} or {0,.1} to place the heads to the right end with the right orientation. There is a documentation for FullForm, one looks into it's output and finds out, where the interesting things do appear, just try it yourself. This method is unfortunately not version independent, but given that Mathematica is also modular (everything is an expression), it is often successful. Answer
Posted 7 years ago
 Unfortunately, version dependent solution is not good enough for me. I am trying to come up with some demonstrations to illustrate high school mathematics concepts (in this case the argument of a complex number), and it would not be acceptable to write a demonstration that works differently (or not work at all) a year from now. I will then simply put an arrowhead to the appropriate place by calculating the position. I was hoping for a more elegant solution. To be honest I don't really see a reason behind this implementation of ParametricPlot. Why is the FullForm output the same if the limits of the parameter interval change? Surely the starting and end values of the parameter interval have some meaning, even though the output is the same if we change them. In any case thank you for your help. Answer
Posted 7 years ago
 Unfortunately, version dependent solution is not good enough for me. Okay. I was hoping for a more elegant solution. And your hope comes true ... you program it along the following lines In:= Clear[arrowParametricPlot] arrowParametricPlot[f_List, p_List] := Block[{[Delta] = (p[] - p[])/100.}, ParametricPlot[f, p, Epilog -> {Arrowheads[.1, 0], Arrow[{f /. p[] -> p[] - [Delta], f /. p[] -> p[]}]}, PlotRange -> All] ] /; Length[f] == 2 && Length[p] == 3 && !FreeQ [f[], p[]] && !FreeQ[f[], p[]] producing pictures like of course, there's no free lunch, so get the color of the arrow right on your own, please. Answer
Posted 5 months ago
 I found a much better and simpler solution on stackexchange that works with diffrent plots including "ParametricPlot". thanks to the user kglr p0 = ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 1}] (*numbers used Arrowheads argument define the size of arrow heads and plot will be divided bt the length of arguments in list to place arrow*) (*negative numbers means reverse arrow*) p0 /. Line[x_] :> {Arrowheads[{.1}], Arrow[x]} p0 /. Line[x_] :> {Arrowheads[{-.1, .1}], Arrow[x]} p0 /. Line[x_] :> {Arrowheads[{-.1, .5}], Arrow[x]} p0 /. Line[x_] :> {Arrowheads[{-.1, .1, .1, .1}], Arrow[x]}  Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments