3
$\begingroup$

I have a vector $<x(t),y(t),z(t)>$ constrained to a unit sphere. I am trying to plot what the vector looks like as time progresses. What would be the easiest approach to visualizing this?

I have

x[t_, α_] := -1/Sqrt[1 + α^2]  Sin[ t Sqrt[1 + α^2]]
y[t_, α_] := -α/(1 + α^2) (Cos[t Sqrt[1 + α^2]] - 1)
z[t_, α_] := -1 - (1 - Cos[t Sqrt[1 + α^2]])/(1 + α^2)

I want to plot the vector as a function of t [0,10] and I guess alpha=1.

$\endgroup$
  • $\begingroup$ Can you post example data? $\endgroup$ – paw Oct 12 '14 at 5:31
  • $\begingroup$ Edited above with my functions $\endgroup$ – yankeefan11 Oct 12 '14 at 5:37
  • 1
    $\begingroup$ @yankeefan11 You should use = rather than := when possible. In this case nothing needs to be delayed (:= is named "SetDelayed"). $\endgroup$ – Coolwater Oct 12 '14 at 6:22
  • $\begingroup$ Related: Finding unit tangent, normal, and binormal vectors for a given r(t) $\endgroup$ – Artes Oct 12 '14 at 8:46
7
$\begingroup$
Manipulate[Show[Graphics3D[{
    {Red, PointSize[0.02], Point[{{0, 0, 0}}]},
    {Opacity[0.2], 
     Sphere[{0, a/(1 + a^2), -1 - 1/(1 + a^2)}, 1/Sqrt[1 + a^2]]}, 
    Arrow[{{0, 0, 0}, {x[t, a], y[t, a], z[t, a]}}]}], 
  ParametricPlot3D[{x[u, a], y[u, a], z[u, a]}, {u, 0, 10}], 
  Axes -> True, PlotRange -> Table[{-3, 2}, {3}]], {t, 0, 10}, {a, 1, 
  4}]

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Did you generate that gif using just mathematica? $\endgroup$ – Coolwater Oct 12 '14 at 6:26
  • 1
    $\begingroup$ @Coolwater LICECap software to screen capture $\endgroup$ – ubpdqn Oct 12 '14 at 7:42
5
$\begingroup$

You can use ParametricPlot3D for this kind of plot. Use Graphics3D if you want to visualize the sphere too.

Show[
 ParametricPlot3D[{x[t, 1], y[t, 1], z[t, 1]}, {t, 0, 10}, 
  PlotStyle -> {Red, Thick}, PlotRangePadding -> 0.31],
 Graphics3D[{Opacity[0.5], Sphere[{0.0, 0.5, -1.5}, 1/Sqrt[2]]}]
 ]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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