免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 发帖

TikZ 绘制二次曲线-圆锥曲线示意图 转载

https://www.latexstudio.net/index/details/index/mid/1566.html






% Copyleft 2015 | Ridlo W. Wibowo
% ridlo.w.wibowo@gmail.com
  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usepackage{verbatim}
  4. \usepackage[active,tightpage]{preview}
  5. \PreviewEnvironment{tikzpicture}
  6. \setlength\PreviewBorder{10pt}
  7. \tikzset{fontscale/.style = {font=\relsize{#1}}}
  8. \usetikzlibrary{arrows}
  9. \usetikzlibrary{decorations.markings}
  10. \tikzset{->-/.style={decoration={
  11.   markings,
  12.   mark=at position #1 with {\arrow{triangle 45}}},postaction={decorate}}}

  13. \begin{document}
  14. \begin{tikzpicture}
  15. \draw[black] (-3,3) ellipse (2 and 0.5);
  16. \draw[black] (3,3) ellipse (2 and 0.5);
  17. \draw[] (-4.95,2.88) -- (-1.05,-2.88);
  18. \draw[] (-4.95,-2.88) -- (-1.05,2.88);
  19. \draw[] (4.95,2.88) -- (1.05,-2.88);
  20. \draw[] (4.95,-2.88) -- (1.05,2.88);

  21. \draw[blue, thick] (-3,-0.6) ellipse (0.4 and 0.1);
  22. \draw[] (-3.8,-0.8) -- (-2.2,-0.8);
  23. \draw[] (-3.8,-0.8) -- (-3.4,-0.4);
  24. \draw[] (-2.2,-0.8) -- (-2.6,-0.4);
  25. \draw[] (-3.4,-0.4) -- (-3.3,-0.4);
  26. \draw[] (-2.6,-0.4) -- (-2.7,-0.4);
  27. \draw[dashed] (-2.7,-0.4) -- (-3.3,-0.4);
  28. \node[] at (-1.5,-0.4) {lingkaran};

  29. \draw[rotate around={20:(-3.26,-1.72)}, blue, thick] (-3.26,-1.72) ellipse (1.2 and 0.2);
  30. \draw[] (-5,-2.7) -- (-1.5,-1.5);
  31. \draw[] (-5,-2.7) -- (-4.4,-1.85);
  32. \draw[] (-4.4,-1.85) -- (-4.1,-1.7);
  33. \draw[] (-1.5,-1.5) -- (-2,-0.88);
  34. \draw[] (-2,-0.88) -- (-2.3,-1);
  35. \draw[dashed] (-2.3,-1) -- (-4.1,-1.7);
  36. \node[] at (-1.2,-1.7) {elips};

  37. \draw[blue, thick] (-4,3.4) .. controls (-4.5,1.2) and (-4.2,1.5) .. (-3,2.5);
  38. \draw[dotted, blue, thick] (-4,3.4) -- (-3,2.5);
  39. \draw[] (-2.4,2.9) -- (-4,0.5);
  40. \draw[] (-2.4,2.9) -- (-4.1,3.8) coordinate (A);
  41. \draw[] (-4,0.5) -- (-4.9,2) coordinate (B);
  42. \draw[dashed] (A) -- (B);
  43. \draw[] (A) -- (-4.28,3.4);
  44. \draw[] (B) -- (-4.7,2.45);
  45. \node[] at (-2,2.2) {parabola};

  46. \draw[] (4.5,-3.8) coordinate (A) -- (4.5,2.8) coordinate (B);
  47. \draw[dashed] (A) -- (3.1,-2.5) coordinate (C);
  48. \draw[] (B) -- (3.2,3.7) coordinate (D);
  49. \draw[dashed] (C) -- (D);
  50. \draw[blue, thick] (4.3,-3.4) coordinate (E) .. controls (4,-0.9) and (3.8,-0.6) .. (3.3,-2.5) coordinate (F);
  51. \draw[dotted, blue, thick] (E) -- (F);
  52. \draw[blue, thick] (4.3,2.6) coordinate (G) .. controls (4,1) and (3.8,0.7) .. (3.3,3.5) coordinate (H);
  53. \draw[dotted, blue, thick] (G) -- (H);
  54. \draw[] (A) -- (4.1,-3.43);
  55. \node[] at (2.5,2.2) {hiperbola};

  56. \pgfpathmoveto{\pgfpoint{-1cm}{-3cm}}
  57. \pgfpatharcto{2cm}{0.5cm}{0}{0}{0}{\pgfpoint{-3cm}{-3.5cm}}
  58. \pgfpathmoveto{\pgfpoint{-5cm}{-3cm}}
  59. \pgfpatharcto{2cm}{0.5cm}{0}{0}{-1}{\pgfpoint{-3cm}{-3.5cm}}
  60. \pgfstroke

  61. \pgfsetdash{{3pt}{3pt}}{0pt}
  62. \pgfpathmoveto{\pgfpoint{-1cm}{-3cm}}
  63. \pgfpatharcto{2cm}{0.5cm}{0}{0}{-1}{\pgfpoint{-3cm}{-2.5cm}}
  64. \pgfpathmoveto{\pgfpoint{-5cm}{-3cm}}
  65. \pgfpatharcto{2cm}{0.5cm}{0}{0}{0}{\pgfpoint{-3cm}{-2.5cm}}
  66. \pgfstroke

  67. \pgfsetdash{{3pt}{0pt}}{0pt}
  68. \pgfpathmoveto{\pgfpoint{1cm}{-3cm}}
  69. \pgfpatharcto{2cm}{0.5cm}{0}{0}{-1}{\pgfpoint{3cm}{-3.5cm}}
  70. \pgfpathmoveto{\pgfpoint{5cm}{-3cm}}
  71. \pgfpatharcto{2cm}{0.5cm}{0}{0}{0}{\pgfpoint{3cm}{-3.5cm}}
  72. \pgfstroke

  73. \pgfsetdash{{3pt}{3pt}}{0pt}
  74. \pgfpathmoveto{\pgfpoint{1cm}{-3cm}}
  75. \pgfpatharcto{2cm}{0.5cm}{0}{0}{0}{\pgfpoint{3cm}{-2.5cm}}
  76. \pgfpathmoveto{\pgfpoint{5cm}{-3cm}}
  77. \pgfpatharcto{2cm}{0.5cm}{0}{0}{-1}{\pgfpoint{3cm}{-2.5cm}}
  78. \pgfstroke
  79. \end{tikzpicture}
  80. \end{document}
复制代码
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

返回列表 回复 发帖