moebius-strip.tex 824 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. \documentclass{standalone}
  2. %This image was created by [Jake](http://tex.stackexchange.com/users/2552/jake) ([source](http://tex.stackexchange.com/a/118573/5645))
  3. \usepackage{pgfplots}
  4. \pgfplotsset{compat=1.9}
  5. \begin{document}
  6. \begin{tikzpicture}
  7. \begin{axis}[
  8. hide axis,
  9. view={40}{40}
  10. ]
  11. \addplot3 [
  12. surf, shader=faceted interp,
  13. point meta=x,
  14. colormap/greenyellow,
  15. samples=80,
  16. samples y=5,
  17. z buffer=sort,
  18. domain=0:360,
  19. y domain=-0.5:0.5
  20. ] (
  21. {(1+0.5*y*cos(x/2)))*cos(x)},
  22. {(1+0.5*y*cos(x/2)))*sin(x)},
  23. {0.5*y*sin(x/2)});
  24. \addplot3 [
  25. samples=50,
  26. domain=-145:180, % The domain needs to be adjusted manually, depending on the camera angle, unfortunately
  27. samples y=0,
  28. thick
  29. ] (
  30. {cos(x)},
  31. {sin(x)},
  32. {0});
  33. \end{axis}
  34. \end{tikzpicture}
  35. \end{document}