Guest User

Untitled

a guest
Nov 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{pgfplots}
  3. usepackage{tikz-3dplot}
  4. pgfplotsset{compat=1.3}
  5.  
  6. begin{document}
  7. tdplotsetmaincoords{60}{120}
  8.  
  9. begin{figure}
  10. centering
  11. begin{tikzpicture}[scale=1.5, tdplot_main_coords, axis/.style={->,blue,thick},
  12. vector/.style={-stealth,red,very thick},
  13. vector guide/.style={dashed,red,thick}]
  14. begin{axis}[
  15. axis lines=center,
  16. axis on top,
  17. xlabel={$x$}, ylabel={$y$}, zlabel={$t$},
  18. domain=0:1,
  19. y domain=0:2*pi,
  20. xmin=-1.5, xmax=1.5,
  21. ymin=-1.5, ymax=1.5, zmin=0.0,
  22. every axis x label/.style={at={(rel axis cs:0,0.5,0)},anchor=south},
  23. every axis y label/.style={at={(rel axis cs:0.5,0,0)},anchor=north},
  24. every axis z label/.style={at={(rel axis cs:0.5,0.5,0.9)},anchor=west},
  25. samples=30]
  26. addplot3 [surf, colormap/blackwhite, shader=flat] ({x*cos(deg(y))},{x*sin(deg(y))},{x});
  27. %standard tikz coordinate definition using x, y, z coords
  28. coordinate (O) at (0,0,0);
  29.  
  30. %tikz-3dplot coordinate definition using x, y, z coords
  31.  
  32. pgfmathsetmacro{axone}{5}
  33. pgfmathsetmacro{ayone}{3}
  34. pgfmathsetmacro{azone}{4}
  35. pgfmathsetmacro{axtwo}{3}
  36. pgfmathsetmacro{aytwo}{5}
  37. pgfmathsetmacro{aztwo}{0}
  38.  
  39. coordinate (P1) at (axone,ayone,azone);
  40. coordinate (P2) at (axtwo,aytwo,aztwo);
  41.  
  42. draw[vector] (O) -- (P1);
  43. draw[vector] (O) -- (P2);
  44.  
  45. end{axis}
  46. end{tikzpicture}
  47. end{figure}
  48. end{document}
  49.  
  50. documentclass[tikz,border=3.14mm]{standalone}
  51. usepackage{pgfplots}
  52. pgfplotsset{compat=1.16}
  53.  
  54. begin{document}
  55. begin{tikzpicture}[scale=1.5,axis/.style={->,blue,thick},
  56. vector/.style={-stealth,red,very thick},
  57. vector guide/.style={dashed,red,thick}]
  58. begin{axis}[
  59. axis lines=center,
  60. axis on top,
  61. xlabel={$x$}, ylabel={$y$}, zlabel={$t$},
  62. domain=0:1,
  63. y domain=0:2*pi,
  64. xmin=-1.5, xmax=1.5,
  65. ymin=-1.5, ymax=1.5, zmin=0.0,
  66. every axis x label/.style={at={(rel axis cs:0,0.5,0)},anchor=south},
  67. every axis y label/.style={at={(rel axis cs:0.5,0,0)},anchor=north},
  68. every axis z label/.style={at={(rel axis cs:0.5,0.5,0.9)},anchor=west},
  69. samples=30]
  70. addplot3 [surf, colormap/blackwhite, shader=flat] ({x*cos(deg(y))},{x*sin(deg(y))},{x});
  71. %standard tikz coordinate definition using x, y, z coords
  72. coordinate (O) at (0,0,0);
  73.  
  74. %tikz-3dplot coordinate definition using x, y, z coords
  75.  
  76. pgfmathsetmacro{axone}{0.5}
  77. pgfmathsetmacro{ayone}{0.3}
  78. pgfmathsetmacro{azone}{0.4}
  79. pgfmathsetmacro{axtwo}{0.3}
  80. pgfmathsetmacro{aytwo}{0.5}
  81. pgfmathsetmacro{aztwo}{0}
  82.  
  83. coordinate (P1) at (axone,ayone,azone);
  84. coordinate (P2) at (axtwo,aytwo,aztwo);
  85.  
  86. draw[vector] (O) -- (P1);
  87. draw[vector] (O) -- (P2);
  88.  
  89. end{axis}
  90. end{tikzpicture}
  91. end{document}
Add Comment
Please, Sign In to add comment