Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am just getting started with Mathematica and need help plotting tangential vectors to a 3D parametric function. I know how to do this in 2D but am unsure how to do it in 3D. Maybe I am using the wrong functions? Anyway, here is my attempt :

Clear[t, x, y, z, P];
x[t_] = 2 Sin[t]; 
y[t_] = 6 Sin[t/2]^2;
z[t_] = 3 Cos[t];
P[t_] = {x[t], y[t], z[t]}; 

curveplot = ParametricPlot3D[P[t], {t, 1, 6}, PlotStyle -> Thickness[0.01]];

velocity[t_] = {x'[t], y'[t], z'[t]};
velvector[t_] := Vector3D[velocity[t], Tail -> P[t], VectorColor -> Blue];

velocityvectors = Graphics3D[Arrow[{{P[t]}, {velocity[t]}}]];

Show[curveplot,
     Table[velocityvectors[t], {t, 1, 6, (6 - 1)/10}],
     PlotRange -> All, AxesLabel -> {"x", "y", "z"}]
share|improve this question
add comment

migrated from math.stackexchange.com Jun 21 '13 at 6:30

This question came from our site for people studying math at any level and professionals in related fields.

marked as duplicate by Jens, Artes, Sjoerd C. de Vries, m_goldberg, Yves Klett Jun 21 '13 at 23:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 5 down vote accepted

Is Vector3D from a package? I don't know it. Take a look:

Clear[t, x, y, z, P];
x[t_] = 2 Sin[t];
y[t_] = 6 Sin[t/2]^2;
z[t_] = 3 Cos[t];
P[t_] = {x[t], y[t], z[t]};
V[t_] = {x'[t], y'[t], z'[t]};
curveplot = ParametricPlot3D[P[t], {t, 1, 6}, PlotStyle -> Thickness[0.01]]

ar = Table[{P[t], P[t] + V[t]}, {t, 1, 6, .5}];
Show[curveplot, 
     Graphics3D[{
        Arrow[ar], 
        Red, AbsolutePointSize@12, Point@ar[[ All, 1]]}],
  PlotRange -> All,  AxesLabel -> {"x", "y", "z"}]

enter image description here

share|improve this answer
    
Thanks so much! –  J. Musk Jun 24 '13 at 0:54
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.