It seems quite embarrassing for me, but somehow I can't draw a tangent line to a surface in a given direction. Assume that I want to visualize directional derivative of the function, say, $(x,y)\mapsto x^2+y^2$, at the point, say, $(1,0.5)$. I tried this:
F[x_, y_] := x^2 + y^2
Manipulate[
Show[{Plot3D[F[x, y], {x, -2, 2}, {y, -2, 2}]},
{ParametricPlot3D[{Cos[phi]*t,Sin[phi]*t,
((D[F[x, y], x] /. x -> 1 /. y -> 0.5)*Cos[phi]
+ (D[F[x, y], y] /. x -> 1 /. y -> 0.5)*Sin[phi])*t},
{t, 0, 2}, PlotStyle -> Thick]}], {phi, 0, 2*Pi, Pi/4}]
to no avail. (I am a bit afraid that I did make some stupid mathematical error; unfortunately, Mathematica's syntax is a bit "perlish" to me: I'm learning to write in it, but have serious difficulties reading it...)
My question is twofold: (1) what is wrong with the above code and (2) what is a "canonical" (read: elegant and possibly fast) way of doing this?