勾股定理的三角形设计/纹理

勾股定理的三角形设计/纹理

我找到了一个非常好且直观的图形来证明毕达哥拉斯定理:

在此处输入图片描述

我的主要问题是如何让三角形呈现出那种“外观”——我真的很喜欢这些颜色如何互相补充,并且看起来有一种有趣的渐变效果。我想使用 TikZ 精确地重现这个图形,但我对 TikZ 了解不多。

我想象绘制三角形只需要粗略浏览一下 TikZ/PGF 手册,但我想知道是否有知识渊博的人知道如何制作上图的外观/感觉(以及三角形边的标签)。

答案1

这是一种可能性,其中scope环境shiftrotate选项用于放置小三角形

在此处输入图片描述

代码

\documentclass[border=0.5cm,varwidth]{standalone}
\usepackage{xcolor,amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,intersections}

\begin{document}
\begin{tikzpicture}[scale=0.8]

\begin{scope}
\draw[gray,shade, top color=white,bottom color =blue!30] (0,0) --
 node[black,left,pos=0.5]{3} +(0,3) --node[black,right,pos=0.4]{5} +(4,0)--
 node[black,below,pos=0.5]{4} cycle;
\end{scope}
\node at (4.5,1.5){$\boldsymbol =$};
\begin{scope}[shift={(6cm,0.05cm)}]
\path[name path=circle] (0,0)  circle(2.5cm);
\path[name path=line] (0,3)--(4,0);
\path [name intersections={of = circle and line}];
\draw[gray,shade, top color=white,bottom color =green!30] (0:0) --
 node[black,left,pos=0.5]{3}+(0,3) -- +($(intersection-1)!0.5!(intersection-2)$)--cycle;
\end{scope}
\begin{scope}[xshift=6.1cm]
\path[name path=circle] (0,0)  circle(2.5cm);
\path[name path=line] (0,3)--(4,0);
\path [name intersections={of = circle and line}];
\draw[gray,shade, left color=white,right color =red!50] (0:0) --
node[black,below,pos=0.5]{4}+(4,0) -- +($(intersection-1)!0.5!(intersection-2)$)--
node[black,above right,pos=0]{5}cycle;
\end{scope}
\end{tikzpicture}


\begin{tikzpicture}[scale=0.8]
\begin{scope}
\draw[gray,shade, top color=white,bottom color =blue!30] (0,0) --
 node[black,left,pos=0.5]{} +(0,3) --node[black,right,pos=0.4]{5} +(4,0)--cycle;
\end{scope}
\node at (4.5,1.5){$\boldsymbol =$};
\begin{scope}[shift={(6.1cm,2.5)},rotate=143,yscale=1,xscale=-1]
\path[name path=circle] (0,0)  circle(2.5cm);
\path[name path=line] (0,3)--(4,0);
\path [name intersections={of = circle and line}];
\draw[gray,shade, top color=white,bottom color =red!50] (0:0) --
node[black,right,pos=0.4]{4}+(4,0) -- +($(intersection-1)!0.5!(intersection-2)$)--cycle;
\end{scope}
\node at (10,1.5){$\boldsymbol +$};
\begin{scope}[shift={(14cm,0.1cm)},rotate=53,yscale=1,xscale=-1]
\path[name path=circle] (0,0)  circle(2.5cm);
\path[name path=line] (0,3)--(4,0);
\path [name intersections={of = circle and line}];
\draw[gray,shade, top color=white,bottom color =green!20] (0:0) --
node[black,right,pos=0.6]{3}+(0,3) -- +($(intersection-1)!0.5!(intersection-2)$)--cycle;
\end{scope}
\end{tikzpicture}

相关内容