Setup Menus in Admin Panel

  • LOGIN
  • No hay productos en el carrito.

Helicoide generalizado (código fuente LaTeX)

Te comparto el código fuente LaTeX2e para generar un helicoide generalizado usando TikZ.

A continuación te comparto el código fuente LaTeX2e para generar un helicoide generalizado usando TikZ.

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{math}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{1pt}
%
% File name: generalized-helicoid.tex
% Author: Efraín Soto Apolinar
% Date of creation: June, 26th 2024.
% Apodaca, N.L., Mexico.
% https://www.aprendematematicas.org.mx/author/efrain-soto-apolinar/instructing-courses/
\begin{document}
%
\tdplotsetmaincoords{70}{120}
%
\begin{tikzpicture}[tdplot_main_coords,scale=1.5]
	\tikzmath{function equis(\t) {return 0.0;};}
	\tikzmath{function ye(\t) {return \t ;};}
	\tikzmath{function zeta(\t) {return 0.50 * (\t - 1.0)^2 ;};}
	\tikzmath{function Equis(\t, \p) {return equis(\t) * cos(\p r) - ye(\t) * sin(\p r) ;};}
	\tikzmath{function Ye(\t, \p) {return equis(\t) * sin(\p r) + ye(\t) * cos(\p r) ;};}
	\tikzmath{function Zeta(\t,\p) {return zeta(\t) + \m * \p ;};}
	%
	\pgfmathsetmacro{\m}{0.25}
	\pgfmathsetmacro{\n}{250}
	\pgfmathsetmacro{\ti}{0.0}
	\pgfmathsetmacro{\tf}{2.0}
	\pgfmathsetmacro{\pi}{0.0}
	\pgfmathsetmacro{\pf}{6.0 * pi}
	\pgfmathsetmacro{\tj}{\ti + (\tf - \ti) / \n}
	\pgfmathsetmacro{\pj}{\pi + (\pf - \pi) / \n}
	% The surface: the generalized helicoid
	% First part: let t to be a constant (circular helices are drawn)
	\foreach \t in {\ti,\tj,...,\tf}{
		\draw[cyan,very thin,opacity=0.35] plot[domain=\pi:\pf,smooth,variable=\p] ({Equis(\t,\p)},{Ye(\t,\p)},{Zeta(\t,\p)});
	}
	% Second part: let \phi to be constant (copies of the profile curve are drawn)
	\foreach \p in {\pi,\pj,...,\pf}{
		\draw[cyan,very thin,opacity=0.35] plot[domain=\ti:\tf,smooth,variable=\t] ({Equis(\t,\p)},{Ye(\t,\p)},{Zeta(\t,\p)});
	}
	% ... and as Michael Jackson said: "This is it!"
\end{tikzpicture}
%
\end{document}

El helicoide generalizado se ve así.

Helicoide generalizada
junio 27, 2024

4 responses on "Helicoide generalizado (código fuente LaTeX)"

  1. The code does not compile

  2. Yes, really, the code compiles just fine.

  3. My apologies: the code DOES compile correctly. Unfortunately, when I used Google translate to convert the web page into English, it inserted spurious spaces in many places, including some such as near the end of tikzmath function definitions, where an extra space is deadly.

Leave a Message

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.

X