1
$\begingroup$

I want to graph a circle in 3d, but don't know the code for it. I've tried the following code, but it doesn't seem to work. enter image description here

$\endgroup$
1
  • $\begingroup$ Since it seems you weren't told yet: please do not post code as an image. Copy the text of your code and paste it in your question. In the meantime, please look at the linked thread to see if anything there suits your needs. $\endgroup$ Commented Sep 20, 2017 at 0:13

1 Answer 1

3
$\begingroup$

Circle is a 2D graphics primitive. The corresponding primitive in 3D would be Cylinder:

Graphics3D[{FaceForm[None], Cylinder[{{0, 0, 0}, {0, 0, 0.01}}]}]

Mathematica graphics

Or use ParametricPlot:

ParametricPlot3D[{Sin[u], Cos[u], 0}, {u, 0, 2 Pi}]

Mathematica graphics

You can also use Line like this:

pts = Table[{Sin[u], Cos[u], 0}, {u, 0, 2 Pi, 0.01}];
Graphics3D[Line[pts]]

Mathematica graphics

$\endgroup$

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