Space Curves in color

© 2004 Robert Ipanaqué Chero
Peruvian Applied & Computational Mathematical Society (Member), Perú
E-mail: robertchero@hotmail.com

Standard three-dimensional plot

ParametricPlot3D[{Cos[t], Sin[t], 0}, {t, 0, 2*Pi}]

ParametricPlot3D[{Cos[t], Sin[t], 0}, {t, 0, 2*Pi}, 
      PlotStyle -> {RGBColor[0, 0, 1]}]

A new command CurvePlot3D

<< Curves3D`

CurvePlot3D[{Cos[t], Sin[t], 0}, {t, 0, 2*Pi}, 
        PlotStyle -> {RGBColor[0, 0, 1]}];

x[u_, v_] := {Cos[u]*Cos[v], Sin[u]*Cos[v], Sin[v]}

g1 = 
        CurvePlot3D[
          Table[x[u, v], {v, -Pi/2, Pi/2, Pi/20}], {u, 0, 
            2*Pi}, 
PlotStyle -> 
            Table[{Hue[i/21]}, {i, 0, 21}]];

g2 = 
        CurvePlot3D[
          Table[x[u, v], {u, 0, 2*Pi, Pi/18}], {v, -Pi/2, 
            Pi/2}, 
PlotStyle -> 
            Table[{Hue[i/37]}, {i, 0, 37}]];

Show[g1, g2];

Further Examples

x[u_, v_] := {Cos[u]*Cos[v], Sin[u]*Cos[v], Sin[v]}

S1 = 
      ParametricPlot3D[
        x[u, v], {u, 0, 2*Pi}, {v, -Pi/2, Pi/2}]

c1 = 
      CurvePlot3D[x[t, t], {t, 0, 2*Pi}, 
        PlotStyle -> {Thickness[0.015], RGBColor[1, 0, 0]}]

Show[c1, S1, ViewPoint -> {3.076,  -1.253,  0.647}]

c2 = 
      CurvePlot3D[x[Sin[t], Sin[2*t]], {t, 0, 2*Pi}, PlotPoints -> 150, 
        PlotStyle -> {Thickness[0.01], RGBColor[1, 1, 0]}]

Show[c2, S1, ViewPoint -> {3.076,  -1.253,  0.647}]

y[u_, v_] := {Cos[u] + v*Cos[u]*Sin[u/2], Sin[u] + v*Sin[u/2]*Sin[u], 
        v*Cos[u/2]}

g3 = 
      CurvePlot3D[
        Table[y[u, v], {v, -1/2, 1/2, 1/8}], {u, 0, 
          2*Pi}, 
PlotStyle -> 
          Table[{Hue[i/9]}, {i, 0, 9}]]

g4 = 
      CurvePlot3D[
        Table[y[u, v], {u, 0, 2*Pi, Pi/15}], {v, -1/2, 
          1/2}, 
PlotStyle -> 
          Table[{Hue[i/31]}, {i, 0, 31}]]

Show[g3, g4]

S2 = 
      ParametricPlot3D[y[u, v], {u, 0, 2*Pi}, {v, -1/2, 1/2}, 
        PlotPoints -> {40, 2}]

c3 = 
      CurvePlot3D[y[t, 1/4], {t, 0, 4*Pi}, 
        PlotStyle -> {Thickness[0.01], 
            RGBColor[0,  1,  0.25098]}]

Show[c3, S2]

c5 = 
      CurvePlot3D[y[t, Sin[20*t]/4], {t, 0, 2*Pi}, PlotPoints -> 200, 
        PlotStyle -> {Thickness[0.01], 
            RGBColor[0,  1,  0.25098]}]

Show[S2, c5]