# plot a specific path on a surface

I have a 3D function (z = f(x, y)). I have plot it correctly as you can see below. Now, I want to show that there are two different paths to reach from Point A to Point B as shown in the following image. As you can see, I have done it using Shockwell in Linux. But, I want to do it in a clean manner in Mathematica. How can I plot a path from Point A to B while the path is on the surface?

And, if it is possible, as you can see, my preference is to draw an arrow. But, it is not totally necessary.

• What are the definitions of f and the specific paths? – Bob Hanlon Sep 19 '16 at 16:48
• – user9660 Sep 19 '16 at 17:29

Draw your plot with Plot3D and your paths with ParametricPlot3D, then combine them with Show

zfunc[x_, y_] := Exp[x y];
path1[x_] := x^2
path2[x_] := Sqrt[x]

Show[
Plot3D[zfunc[x, y], {x, 0, 1.1}, {y, 0, 1.1}],
(ParametricPlot3D[{
{x, path1[x], zfunc[x, path1[x]]},
{x, path2[x], zfunc[x, path2[x]]}},
{x, 0, 1},
PlotStyle -> {Directive[{Red, Arrowheads[.02]}],
Directive[{Blue, Arrowheads[.02]}]}] /. Line -> Arrow)
] • Thanks Jason. Sorry for late response. I was wondering for two things. 1- sometimes the arrow hides behind the surface. How can I bring it forward? 2- Since I am a little bit stupid on Mathematica, how can I increase arrow's width? Make it bolder as we speak. – Millad Sep 21 '16 at 18:34
• To make the path always on top of the surface, you could manually put in an offset in the z-coordinate of the paths: ParametricPlot3D[{{x, path1[x], zfunc[x, path1[x]] + .01}, {x, path2[x], zfunc[x, path2[x]] + .01}} for example offsets the plot by 0.01 in the z-direction. – Jason B. Sep 21 '16 at 19:50
• To bolden the lines, you could change Line-> Arrow to Line[pts_] :> Arrow[Tube[pts, .0075], {0, -.1}] – Jason B. Sep 21 '16 at 19:53
• Thanks Jason. Appreciate it. I was hoping that there might be a way to show the arrows like threads. This way that you are mentioning would shift the arrow up which in some cases will detach the arrow from the surface. Also, for the top gray section, it will have no effect :) – Millad Sep 21 '16 at 20:23