Stereographically Nested Tori

stereographically_nested_tori

I thought it would be cool to show how to make stereographically nested toroidal solenoids.
Essentially, we make stereographically nested tori, and then we find their solenoid.
In the code below there are functions which determine the two radii of the torus; namely, “radius” and “centershift”.
Try setting different values for \toggleangle, and \frequency!

Modifying the \toggleangle will produce the transformation shown in the .gif, and \frequency will change the frequency of the solenoids.

stereographically_nested_tori_gif

\documentclass[tikz, border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\pgfmathdeclarefunction{sphereX}{2}{%
% #1 - longitude
% #2 - latitude
\pgfmathparse{cos(#2)*cos(#1)}%
}
\pgfmathdeclarefunction{sphereY}{2}{%
% #1 - longitude
% #2 - latitude
\pgfmathparse{cos(#2)*sin(#1)}%
}
\pgfmathdeclarefunction{sphereZ}{2}{%
% #1 - longitude
% #2 - latitude
\pgfmathparse{sin(#2)}%
}
\pgfmathdeclarefunction{radius}{1}{%
\pgfmathparse{
sqrt(
1 / cos(#1)^2 -
cos(#1)
)
}%
}
\pgfmathdeclarefunction{centershift}{1}{%
\pgfmathparse{1 / cos(#1)}%
}
\begin{document}
\tdplotsetmaincoords{60}{80}
\begin{tikzpicture}[tdplot_main_coords]
\clip[tdplot_screen_coords] (-3,-3) rectangle (3,3);
\foreach \toggleangle in {%
10%
,40%
,70%
}{
% lines of longitude
\pgfmathsetmacro{\startlatitude}{0}
\pgfmathsetmacro{\endlatitude}{360}
\pgfmathsetmacro{\sampleslatitude}{10}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Leave a Reply

Your email address will not be published.