0
$\begingroup$

I have a curve in space, already plotted:

uno = ParametricPlot3D[
  {Sqrt[7]/3 * Cos[t], 1/9 + 2 Sqrt[7]/9 * Sin[t], 
   2/9 (1 + 2 Sqrt[7] Sin[t])}, {t, 0, 2 Pi},
  PlotStyle -> Thick
 ]

Now, I want to connect several points on this ellipse to the origin by straight lines. I try with Table and Line but just got lines connecting the center of the ellipse and the contour. Any ideas?

$\endgroup$
  • 3
    $\begingroup$ Which "several points"? I don't see them anywhere in your question. Otherwise, you can just do something like Line[{{0, 0, 0}, #}] & /@ points and then display them with Graphics3D[]. $\endgroup$ – J. M. is in limbo Jun 2 '15 at 22:32
3
$\begingroup$

Since you didn't exactly specify which points you are interested in, in a first attempt I will just extract all the points that ParametricPlot3D has already calculated to plot your ellipse.

points = Cases[uno, Line[{pts__}] -> pts, Infinity];

Show[
 uno,
 Graphics3D[{Red, Line[{{0, 0, 0}, #}] & /@ points}],
 Graphics3D[{Opacity[0.1], Green,
   InfinitePlane[{{1, 0, 0}, {0, 0, 0}, {0, 1, 0}}],
   InfinitePlane[{{1, 0, 0}, {0, 0, 0}, {0, 0, 1}}]
   }],
 ViewPoint -> {20, 20, 10}, ViewAngle -> Automatic
]

Mathematica graphics


Alternatively, of course, you could use Table or similar constructs to generate some evenly spaced points, if that's what you are after.

evenlines = Table[
   Line[{
     {0, 0, 0},
     {Sqrt[7]/3*Cos[t], 1/9 + 2 Sqrt[7]/9*Sin[t], 
      2/9 (1 + 2 Sqrt[7] Sin[t])}
     }],
   {t, 0, 2 Pi - Pi/8, Pi/8}
  ];

Show[
 uno,
 Graphics3D[{Red, Thick, evenlines}],
 Graphics3D[{Opacity[0.1], Green,
   InfinitePlane[{{1, 0, 0}, {0, 0, 0}, {0, 1, 0}}],
   InfinitePlane[{{1, 0, 0}, {0, 0, 0}, {0, 0, 1}}]
   }],
 ViewPoint -> {40, -60, 15}, ViewAngle -> Automatic
]

Mathematica graphics

$\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.