我需要哪些包和命令来在 LaTeX 中创建 Jacob Barnett 所想到的形状?

我需要哪些包和命令来在 LaTeX 中创建 Jacob Barnett 所想到的形状?

我观看了“60 分钟”演讲和“numberphile”youtube 视频,讨论了 Jacob Barnett 如何将数字视为形状。在这两个视频中,他们都提到 Barnett 将数字视为分形形状,由重叠/包裹相同形状的后续多边形的价/外顶点的多边形组成。例如,数字 9 被认为是一个三角形,三角形的每个顶点都包裹着一个顶点。对于 27,重现 9 的形状,但添加包裹 9 形状的每个价顶点的三角形。

视频链接:(numberphile)https://www.youtube.com/watch?v=hP-DZMmQBng

(60 分钟演讲/需要访问“CBS All Access”)https://www.cbsnews.com/news/jake-math-prodigy-proud-of-his-autism/

据我所知:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\tikzset{
    buffer/.style={
        draw,
        shape border rotate=180,
        regular polygon,
        regular polygon sides=3,
        fill=white,
        node distance=2cm,
        minimum height=4em
    }
}

\begin{document}
\begin{tikzpicture}
\node[buffer]{};
\end{tikzpicture}


\begin{tikzpicture}
\node[buffer]{};
\end{tikzpicture}
\end{document}

是否有可用的包和命令来创建这样的形状?

答案1

我相信有些tikz专家可以做得更好,但这可能是一个起点。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usepackage{caption}

\tikzset{
    buffer/.style={
        draw,
        regular polygon,
        regular polygon sides=3,
        minimum size=20em
    },
    pics/nine/.style 2 args= {code={% 
        \node[buffer, fill=#1] (A) {};
        \foreach \mycorner in {1,2,3}
        \node[buffer, fill=#2, scale=.33, transform canvas] at (A.corner \mycorner) {};
    }},
}

\begin{document}
    \begin{figure}
        \centering
        \begin{tikzpicture}
            \node[buffer, fill=red]{};
        \end{tikzpicture}
        \caption{Number 3}
    \end{figure}
    \begin{figure}
    \centering
        \begin{tikzpicture}
            \node[buffer, fill=red]{};
            \node[buffer, yscale=-1, fill=orange]{};
        \end{tikzpicture}
        \caption{Number 6}
    \end{figure}
    \begin{figure}
    \centering
        \begin{tikzpicture}
            \pic {nine={red}{orange}}; 
        \end{tikzpicture}       
        \caption{Number 9}
    \end{figure}
    \begin{figure}
    \centering
        \begin{tikzpicture}
            \node[buffer, fill=red] (B) {};
            \foreach \mycorner in {1,2,3}
                \pic[scale=.33, transform shape] at (B.corner \mycorner) {nine={orange}{red}};
        \end{tikzpicture}
        \caption{Number 27}
    \end{figure}
    \begin{figure}
        \centering
        \begin{tikzpicture}
            \path (-4.4,-5.1) rectangle (4.4,5.1);
            \node[buffer, fill=red] (B) {};
            \foreach \mycorner in {1,2,3}
            \pic[scale=.33, transform shape] at (B.corner \mycorner)
                {nine={orange}{red}};
            \node[buffer, fill=orange, yscale=-1] (C) {};
            \begin{scope}[yscale=-1]
            \foreach \mycorner in {1,2,3}
            \pic[scale=.33, transform shape] at (C.corner \mycorner)
            {nine={red}{orange}};           
            \end{scope}
        \end{tikzpicture}
        \caption{Number 54}
    \end{figure}
\end{document}

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

相关内容