nm9505

Perspectiva En tikz-3dplot

Mar 24th, 2023
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 5.68 KB | Science | 0 0
  1. \documentclass{article}[pstricks,border=8pt,12pt]
  2. \usepackage[utf8]{inputenc}
  3. \usepackage{geometry} [a4paper,lmargin=1.5cm,rmargin=1.5cm,Botton=1.5cm,top=1.75cm]
  4. \usepackage{graphicx}
  5. \usepackage{wrapfig}
  6. \usepackage{color}
  7. \usepackage{amsmath}
  8. \usepackage[T1]{fontenc}
  9. \usepackage{amsfonts} \usepackage{amssymb}
  10. \usepackage{mathrsfs}
  11. \usepackage{cancel}
  12. \usepackage[all]{xy}
  13. \usepackage{pstricks}
  14. \usepackage{pst-all}
  15. \usepackage{pst-solides3d}
  16. \usepackage{fancybox}
  17. \usepackage{tikz}
  18. \usepackage{tikz-3dplot}
  19. \usepackage{gnuplottex}
  20.  
  21. \tikzset{flippedeventlabel/.append style={align=center}}
  22. \usetikzlibrary{matrix.skeleton}
  23. \usetikzlibrary[shapes,arrows,positioning,fit,backgrounds,intersections,shadows,calc,shadings]
  24. \usetikzlibrary{positioning} \usetikzlibrary{decorations.text} \usetikzlibrary{decorations.pathmorphing}
  25.  
  26. \pgfdeclarelayer{background layer}
  27. \pgfdeclarelayer{foreground layer}
  28. \pgfsetlayers{background layer,main,foreground layer}
  29. %\usetikzlibrary{datavisualization.formats.functions}
  30. \usepackage{pgf-pie}
  31. \usepackage{color,colortbl}
  32. \usepackage{lscape}
  33.  
  34.  
  35. \usepackage{pgfplots}
  36. \pgfplotsset{compat=newest}
  37. \usetikzlibrary{datavisualization} \usetikzlibrary[shapes,arrows,positioning,fit,backgrounds,intersections,shadows,calc,datavisualization.formats.functions]
  38. \usetikzlibrary{patterns}
  39. \usepackage[colorlinks=true,linkcolor=black,citecolor=black,filecolor=magenta,urlcolor=blue]{hyperref}
  40. %Paquete de estilo de referencias
  41. \urlstyle{same}
  42. \title{\textcolor{magenta}{\textbf{Perspectiva en \texttt{tikz-3dplot}}} }
  43. \author{Nimrod Rodríguez\\
  44. \href{sitio}{\underline{\textcolor{red}{enlace:}
  45. Código \LaTeX }}}
  46. \date{\today}
  47. % Start the document
  48.  
  49. \begin{document}
  50. \pagecolor{brown!70!red!20!black}
  51. % Definición local de colores
  52. \colorlet{AnguloH}{green!50!black}
  53. \colorlet{AnguloV}{magenta}
  54. \colorlet{Cesferica}{red}
  55. \colorlet{Ccilindrica}{blue}
  56. %\begin{landscape}
  57. \tikz \draw (3,10)  node[scale=0.5,rotate=15,circle,fill=yellow!40,text width=3cm]
  58. {\maketitle };
  59.  
  60. \begin{tikzpicture}[ information text/.style={rounded corners, fill=orange!60,inner sep=2ex}]
  61. \draw [xshift=1.85cm,fill=orange!60]  node  [text width=14cm, information text,scale=1]
  62. {
  63. 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:
  64. \begin{itemize}
  65. \item La primera \textcolor{AnguloH}{$\theta_H$} grados respecto del eje \textbf{horizontal} (Y en el presente ejemplo).
  66. \item La segunda \textcolor{AnguloV}{$\theta_V$} grados respecto del eje \textbf{vertical} (Z en el presente ejemplo).
  67. \end{itemize}
  68. 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.};
  69. \end{tikzpicture}
  70. \begin{center}
  71. %\pagecolor{brown!60!red!20!black}
  72. \tdplotsetmaincoords{70}{110}
  73.  
  74. \begin{tikzpicture}[scale=0.7,tdplot_main_coords, information text/.style={rounded corners, fill=orange!60,inner sep=2ex}]
  75.  
  76. %\tdplotdrawarc[gray, fill=brown!60!red!20!black]{(0,0,-2)}{10}
  77. %{0}{360}{above=0.5cm,red,rectangle,fill=white}{}
  78.  
  79.  
  80. \tdplotsphericalsurfaceplot[smooth]{24}{24}
  81. {2}{black}{green}
  82. {\draw[color=orange,ultra thick,<->] (-9.5,0,-2) -- (9.5,0,-2) node[anchor=north east]{$\Large{X}$};}
  83. {\draw[color=red,ultra thick,<->] (0,-9.5,-2) -- (0,9.5,-2) node[anchor=north west]{$\Large{Y\hat{i}}$};}
  84. {}
  85. \foreach \b in {-1.6,-1.4,...,1.8}
  86. {
  87. \pgfmathsetmacro {\k}{sqrt(4-\b^2)}
  88. \pgfmathsetmacro {\t}{4*\k/(2-\b)}
  89. \foreach \a in {0,5,...,355}
  90. {
  91. \tdplotsinandcos{\sintheta}{\costheta}{\a}
  92. \draw[dashed, blue] (0,0,2)--(\k*\costheta, \k*\sintheta, \b);
  93. \draw[ blue] (\k*\costheta, \k*\sintheta, \b)--(\t*\costheta, \t*\sintheta, -2);
  94.  
  95. \fill[white] (\k*\costheta, \k*\sintheta, \b) circle(1pt);
  96. \fill[green] (\t*\costheta, \t*\sintheta, -2)circle(1pt);
  97. }
  98. }
  99. %\draw (0.75,0.75,0.75) node[right=0.2cm]{$P=$(x, y, z)};
  100.  
  101. \fill[white] (0,0,2) circle (2pt);
  102. \fill [white](0,0,-2) circle (2.5pt);
  103. \draw (9.5,0,-2)node[white, below=1cm] {\LARGE{Proyección Estereográfica de $\mathcal{S}^3$ en $\mathbb{C}$}};
  104. \draw (10,0,-2)node[white, below=2cm] {\LARGE{$(x,y,z)$ $\mapsto$ $\frac{x}{1-z} + \frac{y}{1-z}\hat{i}$}};
  105. \draw [xshift=1.85cm]  node  [below=7cm,text width=5.5cm, information text,scale=1.5]
  106. {
  107. \texttt{\textbackslash tdplotsetmaincoords\{\textcolor{AnguloH}{70}\}\{\textcolor{AnguloV}{110}\} }\\
  108.  
  109. \texttt{\textbackslash begin\{tikzpicture\} } \\
  110.  
  111. \hspace{1cm} $\vdots$ \hspace{0.2cm} \textcolor{blue}{\tiny{código}}\\
  112.  
  113. \texttt{\textbackslash end\{tikzpicture\} }
  114. };
  115. \end{tikzpicture}
  116.  
  117. \end{center}
  118. %\end{landscape}
  119. \end{document}
  120.  
  121.  
Add Comment
Please, Sign In to add comment