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.

This question already has an answer here:

I have no idea how to plot the following piecewise parametric curve in Mathematica;

r[t_] := Piecewise[{{{5*t, 0, 3*(1 + Cos[t])}, 0 <= t <= Pi}, 
         {{5*Cos[t - 3*(Pi/2)] + 5*Pi, 5*Sin[t - 3*(Pi/2)] + 5, 0}, 
           Inequality[Pi, Less, t, LessEqual, 2*Pi]}, 
         {{5*Pi + 3*Cos[t - 3*(Pi/2)], 2*5 - 3 + 3*Sin[t - 3*(Pi/2)], 
             (1/(2*Pi))*(t - 2*Pi)^2}, 
     Inequality[2*Pi, Less, t, LessEqual, 4*Pi]}, 
         {{-3*(t - 17*(Pi/3)), 10, (-Pi^(-1))*t^2 + 10*t - 22*Pi}, 
           Inequality[4*Pi, Less, t, LessEqual, 5*Pi]}, 
         {{-3*t + 17*Pi, 
      10, -972*Pi + 540*t - (99*t^2)/Pi + (6*t^3)/Pi^2}, 
           Inequality[5*Pi, Less, t, LessEqual, 6*Pi]}, 
         {{-Pi - 3*Sin[t], (9/40)*((1/3)*(20 + 18*Pi) - t)^2, 
      3*Cos[t] - 3}, 
           Inequality[6*Pi, Less, t, LessEqual, 8*Pi]}, 
         {{-25*Pi + 25*t - (19*t^2)/(4*Pi) + t^3/(4*Pi^2), 
             (-(25/2))*(140 - 132*Pi + 
          27*Pi^2) + (15*(80 - 74*Pi + 15*Pi^2)*t)/
                 (2*Pi) - (3*(180 - 164*Pi + 33*Pi^2)*t^2)/(8*Pi^2) - 
               ((-50 + 45*Pi - 9*Pi^2)*t^3)/(20*Pi^3), 
      1056 - (360*t)/Pi + 
               (81*t^2)/(2*Pi^2) - (3*t^3)/(2*Pi^3)}, 
     Inequality[8*Pi, Less, t, 
             LessEqual, 10*Pi]}}]; 

When it is plotted, I would like to show a small sphere centered at the point where r]t] == 0.

share|improve this question

marked as duplicate by belisarius, Sjoerd C. de Vries, Michael E2, István Zachar, halirutan Sep 29 '13 at 13:39

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.

    
What in particular do you have a problem with? ParametricPlot3D[r[t], {t, 0, 10 Pi}] looks fine to me –  ssch Sep 28 '13 at 22:56
    
Sorry, I forgot to add another part to the question. I was going to ask how I'd go about putting a sphere at r[t_]=0 –  Tim Sep 29 '13 at 0:07
    
Possible duplicate: Adding a Sphere onto an existing 3D plot. Related: ParametricPlot3D and Sphere Graphics. –  Michael E2 Sep 29 '13 at 1:33
1  
@MichaelE2 The first link is the SAME function! Voting to close as Homework! :) –  belisarius Sep 29 '13 at 2:16
    
@belisarius How funny! I was too tired to notice, I guess. I thought halirutan's graph below looked familiar. –  Michael E2 Sep 29 '13 at 11:57

1 Answer 1

ParametricPlot3D is perfect for your needs. Regarding your last comment about the Sphere, there are several ways. One easy way is to create the parametric plot and another Graphics3D showing the sphere and put everything with Show together. In the following r[t] is your piecewise function

Show[
 ParametricPlot3D[r[t], {t, 0, 10 Pi}],
 Graphics3D[{Opacity[.5], Blue, Sphere[r[0], .5]}]
 ]

Mathematica graphics

share|improve this answer
    
thank you so much –  Tim Sep 29 '13 at 1:20

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