nm9505

PERSPECTIVA EN Tikz-3dplot

Apr 11th, 2023 (edited)
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 10.17 KB | Science | 0 0
  1. \documentclass{article}[pstricks,border=8pt,12pt] \usepackage[utf8]{inputenc}
  2. \usepackage{geometry} [a4paper,lmargin=1.5cm,rmargin=1.5cm,Botton=1.5cm,top=1.75cm] \usepackage{graphicx}
  3. \usepackage{wrapfig}
  4. \usepackage{color}
  5. \usepackage{amsmath}
  6. \usepackage[T1]{fontenc}
  7. \usepackage{amsfonts}
  8. \usepackage{amssymb}
  9. \usepackage{mathrsfs}
  10. \usepackage{cancel}
  11. \usepackage[all]{xy}
  12. \usepackage{pstricks}
  13. \usepackage{pst-all}
  14. \usepackage{pst-solides3d}
  15. \usepackage{fancybox}
  16. \usepackage{tikz}
  17. \usepackage{tikz-3dplot}
  18. \usepackage{gnuplottex}
  19. \tikzset{flippedeventlabel/.append style={align=center}} \usetikzlibrary{matrix.skeleton} \usetikzlibrary[shapes,arrows,positioning,fit,backgrounds,intersections,shadows,calc,shadings]
  20. \usetikzlibrary{positioning}
  21. \usetikzlibrary{decorations.text} \usetikzlibrary{decorations.pathmorphing} \pgfdeclarelayer{background layer}
  22. \pgfdeclarelayer{foreground layer}
  23. \pgfsetlayers{background layer,main,foreground layer}
  24. %\usetikzlibrary{datavisualization.formats.functions} \usepackage{pgf-pie}
  25. \usepackage{color,colortbl}
  26. \usepackage{lscape}
  27. \usepackage{pgfplots}
  28. \pgfplotsset{compat=newest}
  29. \usetikzlibrary{datavisualization} \usetikzlibrary[shapes,arrows.meta,positioning,fit,backgrounds,intersections,shadows,calc,datavisualization.formats.functions] \usetikzlibrary{patterns} \usepackage[colorlinks=true,linkcolor=black,citecolor=black,filecolor=magenta,urlcolor=blue]{hyperref} %Paquete de estilo de referencias
  30. \urlstyle{same}  
  31. \date{\today}
  32. % Start the document
  33. \begin{document}
  34. \pagecolor{black}
  35. % Definición local de colores
  36. \colorlet{AnguloH}{green!50!black} \colorlet{AnguloV}{magenta} \colorlet{Cesferica}{red} \colorlet{Ccilindrica}{blue}
  37. %\begin{landscape}
  38. \begin{center}
  39. \tdplotsetmaincoords{50}{135} \begin{tikzpicture}[scale=3.5,tdplot_main_coords] \coordinate (O) at (0,0,0); \coordinate (x) at (1,0,0); \coordinate (y) at (0,1,0); \coordinate (z) at (0,0,1); \draw[thick, >=Stealth, ->] (O) -- (x) node[anchor = north]{x}; % x
  40. \draw[thick, >=Stealth, ->] (O) -- (y) node[anchor = north]{y}; % y
  41. \draw[thick, >=Stealth, ->] (O) -- (z) node[anchor = south]{z}; % z
  42. \coordinate (xz) at (1,0,1); \coordinate (yz) at (0,1,1);
  43. \coordinate (xy) at (1,1,0);
  44. % text on the yz plane
  45. \draw[canvas is yz plane at x = 0, transform shape, draw = red, fill = white, opacity = 1] (yz) rectangle (O);
  46. \node[canvas is yz plane at x = 0] at (0,0.5,0.5) {\textcolor{magenta}{Tikz-3dplot}};
  47. \node[canvas is yz plane at x = 0] at (0,0.5,0.35) {\tiny{\textcolor{blue}{Nimrod Rodriguez}}};
  48. % text on the xz plane (Notice: it seems that the text has been reflected)
  49. \draw[canvas is xz plane at y = 0,transform shape, draw = blue, fill = blue, opacity = 0.8] (xz) rectangle (O);
  50. \node[canvas is zx plane at y = 0, align = center,rotate=-90] at (0.5,0,0.85){\textbf{\textcolor{white}{canvas zx}}};
  51. \node[canvas is zx plane at y = 0, align = center,rotate=-90] at (0.5,0,0.7){\Large{\textbf{\textcolor{white}{\LaTeX}}}};
  52. \node[canvas is zx plane at y = 0, align = center,rotate=-90] at (0.5,0,0.45){\textbf{\textcolor{white}{canvas xz}}};
  53. \node[canvas is xz plane at y = 0, align = center] at (0.5,0,0.3){\Large{\textbf{\textcolor{white}{\LaTeX}}}};
  54. \draw[canvas is xy plane at z = 0, transform shape, draw = magenta, fill = green!10, opacity = 0.8] (xy) rectangle (O);
  55. \node[canvas is xy plane at z = 0, align = center,rotate=180] at (0.5,0.5,0){\textcolor{magenta}{Perspectiva En}};
  56.  
  57. \end{tikzpicture}
  58. \end{center}
  59. \begin{tikzpicture}[ information text/.style={rounded corners, fill=blue!30!green!20,inner sep=2ex}] \draw [xshift=1.85cm,fill=orange!60] node [text width=14cm, information text,scale=1] {\qquad A continuación una ilustración en el uso de \texttt{\textbackslash tdplotsetmaincoords\{\textcolor{AnguloH}{$\theta_H$}\}\{\textcolor{AnguloV}{$\theta_V$}\} }, uno de los comamdos en el \texttt{frontend} de \texttt{Tikz-3dplot} para configurar la perspectiva de los ejes cartesianos en este paquete, esto mediante dos parámetros angulares, cuyos valores son los que van entre las llaves. Este comamdo se coloca justamente antes del entorno \texttt{tikzpicture} que contiene todo el código del gráfico. Recordamos que \LaTeX, utiliza el formato estándar para la perspectiva tridimensional: Un eje horizontal y uno vertical que se encuentran en el plano de la hoja del papel y un tercer eje que apunta saliendo perpendicularmente del plano que contiene a los primeros dos. Cuál se etiqueta como X, Y o Z, es a conveniencia, sin embargo lo usual es que Y sea el horizontal, Z el vertical y X el perpendicular saliendo del plano que contiene a los dos primeros. Cómo puede verse, este Comamdo ha sido desarrollado o diseñado, para dos rotaciones: \begin{itemize} \item La primera \textcolor{AnguloH}{$\theta_H$} grados respecto del eje \textbf{horizontal} (Y en el presente ejemplo). \item La segunda \textcolor{AnguloV}{$\theta_V$} grados respecto del eje \textbf{vertical} (Z en el presente ejemplo). \end{itemize} Si se desea implementar rotación respecto del tercer eje (X en el presente ejemplo) perpendicular al plano de los primeros dos, esto se realiza en la configuración del entorno \texttt{tikzpicture}, mediante \texttt{\textbackslash begin\{tikzpicture\} }$[rotate=\textcolor{blue}{\theta_P,...}]$, como se puede ver en el texto informativo de las figuras.};
  60. \end{tikzpicture}
  61. %La proyección-1
  62. \begin{center}  
  63. \tdplotsetmaincoords{85}{110}
  64. \begin{tikzpicture}[scale=0.7,tdplot_main_coords, information text/.style={rounded corners, fill=white!20!blue!10,inner sep=2ex}]
  65.  
  66. \tdplotsphericalsurfaceplot[smooth]{24}{24} {2}{black}{green} {\draw[color=orange,ultra thick,<->] (-9.5,0,-2) -- (9.5,0,-2) node[anchor=north east]{$\Large{X}$};} {\draw[color=red,ultra thick,<->] (0,-9.5,-2) -- (0,9.5,-2) node[anchor=north west]{$\Large{Y\hat{i}}$};} {}
  67. \foreach \b in {-1.8,-1.6,...,1.8}
  68. {
  69. \pgfmathsetmacro {\k}{sqrt(4-(\b)^2)}
  70. \pgfmathsetmacro {\t}{4*\k/(2-\b)}
  71. \pgfmathsetmacro {\a}{50}
  72.  
  73. \tdplotsinandcos{\sintheta}{\costheta}{\a}
  74. \draw[dashed, blue] (0,0,2)--(\k*\costheta, \k*\sintheta, \b);
  75. \draw[blue] (\k*\costheta, \k*\sintheta, \b)--(\t*\costheta, \t*\sintheta, -2);
  76. \fill[white] (\k*\costheta, \k*\sintheta, \b) circle(1pt); \fill[green] (\t*\costheta, \t*\sintheta, -2)circle(1pt);
  77. }
  78. \fill[white] (0,0,2) circle (2pt); \fill [white](0,0,-2) circle (2.5pt);
  79. \draw (9.5,0,-2)node[white, below=1cm] {\LARGE{Proyección Estereográfica de $\mathcal{S}^3$ en $\mathbb{C}$}};
  80. \draw (10,0,-2)node[white, below=2cm] {\LARGE{$(x,y,z)$ $\mapsto$ $\frac{x}{1-z} + \frac{y}{1-z}\hat{i}$}};
  81. \draw [xshift=1.85cm] node [below=7cm,text width=5.5cm, information text,scale=1.5] { \texttt{\textbackslash tdplotsetmaincoords\{\textcolor{AnguloH}{85}\}\{\textcolor{AnguloV}{110}\} }\\ \texttt{\textbackslash begin\{tikzpicture\} } \\ \hspace{1cm} $\vdots$ \hspace{0.2cm} \textcolor{blue}{\tiny{código}}\\ \texttt{\textbackslash end\{tikzpicture\} } }; \end{tikzpicture}
  82. \end{center}
  83. %La proyección-2
  84. \begin{center}  
  85. \tdplotsetmaincoords{25}{125}
  86. \begin{tikzpicture}[scale=0.7,tdplot_main_coords, information text/.style={rounded corners, fill=white!20!blue!10,inner sep=2ex}]
  87.  
  88. \tdplotsphericalsurfaceplot[smooth]{24}{24} {2}{black}{green} {\draw[color=orange,ultra thick,<->] (-9.5,0,-2) -- (9.5,0,-2) node[anchor=north east]{$\Large{X}$};} {\draw[color=red,ultra thick,<->] (0,-9.5,-2) -- (0,9.5,-2) node[anchor=north west]{$\Large{Y\hat{i}}$};} {}
  89. \foreach \b in {-1.4,-1.2,...,1.4}
  90. {
  91. \pgfmathsetmacro {\k}{sqrt(4-(\b)^2)}
  92. \pgfmathsetmacro {\t}{4*\k/(2-\b)}
  93. \foreach \a in {25,30,...,130}
  94. {
  95. \tdplotsinandcos{\sintheta}{\costheta}{\a}
  96. \draw[dashed, blue] (0,0,2)--(\k*\costheta, \k*\sintheta, \b);
  97. \draw[ blue] (\k*\costheta, \k*\sintheta, \b)--(\t*\costheta, \t*\sintheta, -2);
  98. \fill[white] (\k*\costheta, \k*\sintheta, \b) circle(1pt); \fill[green] (\t*\costheta, \t*\sintheta, -2)circle(1pt);
  99. }
  100. }
  101. \fill[white] (0,0,2) circle (2pt); \fill [white](0,0,-2) circle (2.5pt);
  102. \draw (9.5,0,-2)node[white, below=1cm] {\LARGE{Proyección Estereográfica de $\mathcal{S}^3$ en $\mathbb{C}$}};
  103. \draw (10,0,-2)node[white, below=2cm] {\LARGE{$(x,y,z)$ $\mapsto$ $\frac{x}{1-z} + \frac{y}{1-z}\hat{i}$}};
  104. \draw [xshift=1.85cm] node [below=9cm,text width=5.5cm, information text,scale=1.5] { \texttt{\textbackslash tdplotsetmaincoords\{\textcolor{AnguloH}{25}\}\{\textcolor{AnguloV}{125}\} }\\ \texttt{\textbackslash begin\{tikzpicture\} } \\ \hspace{1cm} $\vdots$ \hspace{0.2cm} \textcolor{blue}{\tiny{código}}\\ \texttt{\textbackslash end\{tikzpicture\} } }; \end{tikzpicture}
  105. \end{center}
  106. \begin{landscape}
  107. %La proyección-3
  108. \begin{center}  
  109. \tdplotsetmaincoords{85}{110}
  110. \begin{tikzpicture}[scale=0.6,tdplot_main_coords, information text/.style={rounded corners, fill=white!20!blue!10,inner sep=2ex}]
  111.  
  112. \tdplotsphericalsurfaceplot[smooth]{24}{24} {2}{black}{green} {\draw[color=orange,ultra thick,<->] (-9.5,0,-2) -- (9.5,0,-2) node[anchor=north east]{$\Large{X}$};} {\draw[color=red,ultra thick,<->] (0,-9.5,-2) -- (0,9.5,-2) node[anchor=north west]{$\Large{Y\hat{i}}$};} {}
  113. \foreach \b in {-1.8,-1.6,...,1.8} {
  114. \pgfmathsetmacro {\k}{sqrt(4-(\b)^2)}
  115. \pgfmathsetmacro {\t}{4*\k/(2-\b)}
  116. \foreach \a in {0,5,...,355}
  117. {
  118. \tdplotsinandcos{\sintheta}{\costheta}{\a}
  119. \draw[dashed, blue] (0,0,2)--(\k*\costheta, \k*\sintheta, \b);
  120. \draw[ blue] (\k*\costheta, \k*\sintheta, \b)--(\t*\costheta, \t*\sintheta, -2);
  121. \fill[white] (\k*\costheta, \k*\sintheta, \b) circle(1pt); \fill[green] (\t*\costheta, \t*\sintheta, -2)circle(1pt);
  122. }
  123. }
  124. \fill[white] (0,0,2) circle (2pt); \fill [white](0,0,-2) circle (2.5pt);
  125. \draw (9.5,0,-2)node[white, below=1cm] {\LARGE{Proyección Estereográfica de $\mathcal{S}^3$ en $\mathbb{C}$}};
  126. \draw (10,0,-2)node[white, below=2cm] {\LARGE{$(x,y,z)$ $\mapsto$ $\frac{x}{1-z} + \frac{y}{1-z}\hat{i}$}};
  127. \draw [xshift=1.85cm] node [below=5cm,text width=6cm, information text,scale=1.5] { \texttt{\textbackslash tdplotsetmaincoords\{\textcolor{AnguloH}{85}\}\{\textcolor{AnguloV}{110}\} }\\ \texttt{\textbackslash begin\{tikzpicture\}} \\ \hspace{1cm} $\vdots$ \hspace{0.2cm} \textcolor{blue}{\tiny{código}}\\ \texttt{\textbackslash end\{tikzpicture\} } }; \end{tikzpicture}
  128. \end{center}
  129.  
  130.  
  131. \end{landscape}
  132. \end{document}
  133.  
Add Comment
Please, Sign In to add comment