# How to create arrowheads in this curve in Mathematica

I am using this code in Mathematica:

    BaseStyle -> Black] & /@ {Plot, Graphics};
font = "CMU Serif";
SetOptions[\$FrontEnd,
DefaultStyleDefinitions ->
FrontEndFileName[{"CMU Serif", "Default.nb"}]];

grids := Table[{i, {AbsoluteThickness[d2], LightGray}}, {i, -600, 600,
1}]
DefPlotStyle := {AxesOrigin -> {0, 0}, Frame -> True,
FrameStyle -> {{AbsoluteThickness[1], Gray}, {AbsoluteThickness[1],
Gray}, {AbsoluteThickness[1], Gray}, {AbsoluteThickness[1],
Gray}}, AspectRatio -> 0.5/GoldenRatio, ImageSize -> {298, 92},
GridLines -> {grids, grids},
GridLinesStyle -> {{AbsoluteThickness[d2],
LightGray}, {AbsoluteThickness[d2], LightGray}},
BaseStyle -> {FontFamily -> font},
LabelStyle -> {FontFamily -> font},
FrameLabel -> {None, None, None,
Style[Rotate["n", -Pi/2], FontFamily -> font]},
AxesStyle -> {{Gray, AbsoluteThickness[d2]}, {Gray,
AbsoluteThickness[d2]}}, Method -> {"AxesInFront" -> False},
FrameTicksStyle -> {{Black, FontSize -> 11,
AbsoluteThickness[d2]}, {}, {}, {}}}

d0 := (Sqrt[5] + 1)/2
d1 := d0 - 1/2
d2 := d0 - 1
d3 := d0 - 3/2

halfEllipseLine[x_] := Module[{a, b, center, ellipsePoints}, a = 1/2;
b = 1/(2*d0);
center = Floor[x] + 0.5;
ellipsePoints =
Table[{center + a Cos[theta], b Sin[theta]}, {theta, 0, Pi,
Pi/20}];
ellipsePoints];

plotrange = {{-1, 5}, {0, 0.618034}};
arstart := 5
arend := 0

Graphics[{Style[
Line[Table[halfEllipseLine[t - 1], {t, arstart, arend + 1, -1}]],
RGBColor @@ ColorData[97, 1]]},
PlotRange -> {{plotrange[[1, 1]] - d3,
plotrange[[1, 2]] + d3}, {plotrange[[2, 1]] - 0,
plotrange[[2, 2]] + 0}}, Evaluate@Join[{DefPlotStyle}],
FrameTicks -> {{None,
None}, {Range[plotrange[[1, 1]], plotrange[[1, 2]]], None}}]


It creates the following plot:

However, I want a plot like this:

Or even one like this:

I made these pictures in paint.net, so they are an approximation of what I want. Do you have any idea how can it be done? Thanks!

With Arrow + BezierCurve (the first and last points are the endpoints; the first two points and last two points define a "velocity" vector, conceptually: the slower the initial velocity, the sooner the trajectory curves over and approaches the other end point along its velocity vector):

With[{vel = 4/3},
Graphics[{Table[
Arrow[BezierCurve[{{x, 0}, {x, vel}, {x - 1, vel}, {x - 1,
0}}]], {x, 1, 5, 1}]
}, Frame -> True, Axes -> True, GridLines -> {Automatic, None}]
]


With[{vel = 4/3},
Table[Arrow[
BezierCurve[{{x, 0}, {x, vel}, {x - 1, vel}, {x - 1, 0}}]], {x,
1, 5, 1}]
}, Frame -> True, Axes -> True, GridLines -> {Automatic, None}]
]


Fiddle with the 0.55 to get the arrowhead in the desired position. 0.55 is a little more than halfway; 0 is the beginning; 1 is the end (default). The tip of the arrowhead itself points along the tangent to the Bezier curve at the tip. (Your drawing has the arrow in the direction of the tangent roughly at the center of the arrowhead. I think that can be done, but it's a bit harder. Update the question if that is required.)

• This worked for me and is exactly what I wanted! It even customizes easily to my specifications: With[{vel = 4/3}, Graphics[{Arrowheads[{{0.05, 0.750}}], Table[Style[ Arrow[BezierCurve[{{x, 0}, {x, vel}, {x - 1, vel}, {x - 1, 0}}]], RGBColor @@ ColorData[97, 1]], {x, 1, 5, 1}]}, PlotRange -> {{plotrange[[1, 1]] - d3, plotrange[[1, 2]] + d3}, {plotrange[[2, 1]] - 0, plotrange[[2, 2]] + 0}}, Evaluate@Join[{DefPlotStyle}], FrameTicks -> {{None, None}, {Range[plotrange[[1, 1]], plotrange[[1, 2]]], None}}]] Thank you very much! Commented Jul 25 at 8:37

There are easier ways to create lines. For example:

HalfEllipseLine[center_, horizontalRadius_, verticalRadius_] :=


We can wrap a line with Arrow (and we'll create all of them at once):

EllipseArrows = Table[Arrow[HalfEllipseLine[{x, 0}, .5, 2]], {x, .5, 4.5, 1}]


Now we can create a display using the directive Arrowheads:

Graphics[{Arrowheads[{{.1, 1}}], EllipseArrows}, Axes -> True]


Of course, you could one-line this:

Graphics[
`