PWWs-01-07

(Last updated: 2016-10-31 10:12) A Pythagorean Theorem: \(a\cdot a' = b\cdot b'+c\cdot c'\)

PWWs-01-07
\documentclass[tikz, border=2pt]{standalone}
\usepackage{amssymb}
\usetikzlibrary{calc}
\usetikzlibrary{math}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \tikzmath{
    \b = 7; \c = 12; \a = sqrt(\b*\b + \c*\c);
    \l = 7;
    \b = \b / \a * \l;
    \c = \c / \a * \l;
    \a = \l;
    \B = asin(\b / \a);
    \C = asin(\c / \a);
  }
  \def\template#1; {
    \coordinate (O) at #1;
    \coordinate (A) at ($(\C:\b)+(O)$);
    \coordinate (B) at ($(\a, 0)+(O)$);
    \coordinate (B1) at ($(0.3*\a, 0)+(O)$);
    \coordinate (A1) at ($(\C:0.7*\b)+(B1)$);
    \draw (O) -- node[below, near start] {$a$} (B) -- node[above right, near end] {$c$} (A) -- node[left] {$b$} cycle;
    \draw (B1) -- node[left] {$b'$} (A1);
    \node[above] () at ($(B1)!0.45!(B)$) {$a'$};
    \node[below] () at ($(A1)!0.3!(B)$) {$c'$};
    \draw[thin] (A) ++(-\B:0.04*\l) -- ++({-90-\B}:0.04*\l) -- ++({180-\B}:0.04*\l);
    \draw[thin] (A1) ++(-\B:0.04*\l) -- ++({-90-\B}:0.04*\l) -- ++({180-\B}:0.04*\l);
  }
  \template{(0, 4)};
  \template{(0, 0)};
  \coordinate (P) at ($(A1)+(0, -0.7*\b*\c/\a)$);
  \draw[thin] (A1) -- (P);
  \draw[thin] (P) ++(0.04*\l, 0) -- ++(0, 0.04*\l) -- ++(-0.04*\l, 0);
  \draw[thin] (P) -- +(0, -0.05*\l) node[coordinate, near end] (p1) {};
  \draw[thin] (B1) -- +(0, -0.05*\l) node[coordinate, near end] (p2) {};
  \draw[thin] (B) -- +(0, -0.05*\l) node[coordinate, near end] (p3) {};
  \node (x) at ($(p1)!0.5!(p2)$) {$x$};
  \node (y) at ($(p1)!0.5!(p3)$) {$y$};
  \draw[-{Latex[length=2mm]}, thin] (x) -- (p1);
  \draw[-{Latex[length=2mm]}, thin] (x) -- (p2);
  \draw[-{Latex[length=2mm]}, thin] (y) -- (p1);
  \draw[-{Latex[length=2mm]}, thin] (y) -- (p3);
\node[below=5mm, align=center] () at ($(O)!0.5!(B)$) {
      $\displaystyle\frac{x}{b}=\displaystyle\frac{b'}{a} \Rightarrow a\cdot x = b\cdot b';$\\
      $\displaystyle\frac{y}{c}=\displaystyle\frac{c'}{a} \Rightarrow a\cdot y = c\cdot c';$\\
      $\therefore\ a\cdot a'=a\cdot(x+y)=b\cdot b'+c\cdot c'.$
    };
\end{tikzpicture}
\end{document}

PWWs-01-06

The Pythagorean Theorem VI

PWWs-01-06
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \tikzmath{
    \a = 5; \b = 12; \c = sqrt(\a*\a + \b*\b);
    \l = 5;
    \a = \a / \c * \l;
    \b = \b / \c * \l;
    \c = \l;
  }
  \coordinate (O) at (0, 0);
  \coordinate (A) at (\a, 0);
  \coordinate (B) at (\a, \b);
  \coordinate (C) at (\c, 0);
  \draw (O) circle [radius=\c];
  \draw (O) -- node[above] {$c$} ($(O)-(C)$) node[left, align=center] {$\displaystyle\frac{c+a}{b}=\displaystyle\frac{b}{c-a}$\\ \\ $a^2+b^2=c^2$};
  \draw (O) -- node[above] {$a$} (A);
  \draw (A) -- node[above] {$c-a$} (C);
  \draw (O) -- node[left] {$c$} (B);
  \draw (A) -- node[right] {$b$} (B);
  \draw[thin] (A) ++(-0.05*\l, 0) -- ++(0, 0.05*\l) -- ++(0.05*\l, 0);
\end{tikzpicture}
\end{document}

PWWs-01-05

The Pythagorean Theorem V

PWWs-01-05
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \tikzmath{
    \a = 5; \b = 12; \c = sqrt(\a*\a + \b*\b);
    \A = acos(\b / \c);
    \B = acos(\a / \c);
    \l = 5;
    \a = \a / \c * \l;
    \b = \b / \c * \l;
    \c = \l;
  }
  \coordinate (O) at (0, 0);
  \coordinate (A) at (0, \a);
  \coordinate (B) at (\b, 0);
  \coordinate (C) at (\a, \a+\b);
  \coordinate (D) at (0, \a+\b);
  \draw[rounded corners=0.01mm] (O) -- node[left] {$a$} (A) -- node[above] {$c$} (B) -- node[below] {$b$} cycle;
  \draw[rounded corners=0.01mm] (A) -- node[right] {$c$} (C) -- node[above] {$a$} (D) -- node[left] {$b$} cycle;
  \draw (O) -- (B) -- (C) -- (D) -- cycle;
  \draw (B) -- node[right, align=center, very near end] {$A=2\cdot\displaystyle\frac{1}{2}ab+\displaystyle\frac{1}{2}c^2=\displaystyle\frac{1}{2}(a+b)^2$\\ \\ $c^2=a^2+b^2$} (C);
  \draw[thin] (0.05*\l, 0) -- ++(0, 0.05*\l) -- ++(-0.05*\l, 0);
  \draw[thin] (D) ++(0.05*\l, 0) -- ++(0, -0.05*\l) -- ++(-0.05*\l, 0);
  \draw[thin] (A) ++(-\A:0.05*\l) -- ++(\B:0.05*\l) -- ++({180-\A}:0.05*\l);
\end{tikzpicture}
\end{document}

PWWs-01-04

The Pythagorean Theorem IV

PWWs-01-04
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \tikzmath{
    \a = 13; \b = 19; \c = sqrt(\a*\a + \b*\b);
    \A = acos(\b / \c);
    \B = acos(\a / \c);
    \l = 5;
    \a = \a / \c * \l;
    \b = \b / \c * \l;
    \c = \l;
  }
  \def\template#1; {
    \draw #1 rectangle ++(\l, \l);
    \draw[rounded corners=0.01mm] #1 ++(\l, \l) -- +(180-\A:\b) -- +(-\l, 0) -- cycle;
    \draw[rotate around={\B:($#1 + (0, \l)$)}] ($#1 + (0, \l)$) rectangle +(\a, \a);
    \draw[rotate around={90-\A:($#1 + (\l, \l)$)}] ($#1 + (\l, \l)$) rectangle +(\b, \b);
  }
  \coordinate (O1) at (0, 0);
  \coordinate (A1) at ($(O1)+(0, \l)$);
  \coordinate (B1) at ($(O1)+(\l, \l)$);
  \filldraw[rotate around={\B:(A1)}, fill=gray, draw=black] (A1) rectangle +(\a, \a);
  \coordinate (C) at ($(B1)+({45+\B}:{sqrt(2)/2*\b})$);
  \coordinate (P1) at ($(C)+(-0.5*\c, 0)$);
  \coordinate (P2) at ($(C)+(0.5*\c, 0)$);
  \coordinate (P3) at ($(C)+(0, 0.5*\c)$);
  \coordinate (P4) at ($(C)+(0, -0.5*\c)$);
  \fill[lightgray] (P1) -- ($(B1)+({\B+90}:\b)$) -- (P4) -- (C) -- cycle;
  \fill[lightgray] (P2) -- ($(B1)+(\B:\b)$) -- (P3) -- (C) -- cycle;
  \fill[gray!80] (P3) -- ($(B1)+({\B+45}:{sqrt(2)*\b})$) -- (P1) -- (C) -- cycle;
  \fill[gray!80] (P4) -- (B1) -- (P2) -- (C) -- cycle;
  \draw (P1) -- (P2);
  \draw (P3) -- (P4);
  \filldraw[fill=lightgray, transform canvas={shift={($(B1)-(C)$)}}] (P1) -- ($(B1)+({\B+90}:\b)$) -- (P4) -- (C) -- cycle;
  \filldraw[fill=lightgray, transform canvas={shift={($(O1)-(C)$)}}] (P2) -- ($(B1)+(\B:\b)$) -- (P3) -- (C) -- cycle;
  \filldraw[fill=gray!80, transform canvas={shift={($(O1)+(\l, 0)-(C)$)}}] (P3) -- ($(B1)+({\B+45}:{sqrt(2)*\b})$) -- (P1) -- (C) -- cycle;
  \filldraw[fill=gray!80, transform canvas={shift={($(A1)-(C)$)}}] (P4) -- (B1) -- (P2) -- (C) -- cycle;
  \filldraw[fill=gray, transform canvas={shift=($(A1)-(C)$)}] (B1) -- ++(-\A:\a) -- ++(\B:\a) -- ++({180-\A}:\a) -- cycle;
  \template{(0, 0)};
\end{tikzpicture}
\end{document}

PWWs-01-03

The Pythagorean Theorem III

PWWs-01-03
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{math}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \tikzmath{
    \a = 13; \b = 19; \c = sqrt(\a*\a + \b*\b);
    \l = 5;
    \A = acos(\b / \c);
    \B = acos(\a / \c);
  }
  \def\template#1; {
    \draw #1 rectangle ++(\l, \l);
    \draw[rounded corners=0.01mm] #1 ++(\l, \l) -- +(180-\A:\b/\c*\l) -- +(-\l, 0) -- cycle;
    \draw[rotate around={\B:($#1 + (0, \l)$)}] ($#1 + (0, \l)$) rectangle +(\a/\c*\l, \a/\c*\l);
    \draw[rotate around={90-\A:($#1 + (\l, \l)$)}] ($#1 + (\l, \l)$) rectangle +(\b/\c*\l, \b/\c*\l);
  }
  \template{(0, 0)};
  \coordinate (O1) at (0, 0);
  \coordinate (A1) at ($(O1)+(0, \l)$);
  \coordinate (B1) at ($(O1)+(\l, \l)$);
  \filldraw[rotate around={\B:(A1)}, fill=gray, draw=black] (A1) rectangle +(\a/\c*\l, \a/\c*\l);
  \filldraw[rotate around={90-\A:(B1)}, fill=gray, draw=black] (B1) rectangle +(\b/\c*\l, \b/\c*\l);
  \def\trans#1#2#3; {
    \coordinate (O) at #1;
    \coordinate (A) at ($({180-\A}:{(\a+\b)/\c*\l}) + (O) + (\l, \l)$);
    \coordinate (B) at ($(\B:{(\a+\b)/\c*\l}) + (O) + (0, \l)$);
    \coordinate (C) at ($(\B:{\b/\c*\l}) + (A)$);
    \coordinate (D) at ($(-\A:{\a/\c*\l}) + (A)$);
    \draw[dashed, rounded corners=0.01mm] (A) -- (C) -- (B);
    \filldraw[fill=gray, draw=black, rounded corners=0.01mm] ($(O) + (0, \l)$) -- (D) -- ($(\B:{#2*\b/\c*\l}) + (A)$) -- ($({\B-180}:{(\a-#2*\b)/\c*\l}) + (A)$) -- cycle;
    \filldraw[fill=gray, draw=black, rounded corners=0.01mm] ($(O) + (\l, \l)$) -- (D) -- ($({180-\A}:{#3*\a/\c*\l}) + (B)$) -- ($({-\A}:{(\b-#3*\a)/\c*\l}) + (B)$) -- cycle;
  }
  \trans{(10, 0)}{0.4}{0.6};
  \template{(10, 0)};
  \trans{(20, 0)}{1}{1};
  \template{(20, 0)};
  \coordinate (O4) at (5, -12);
  \coordinate (A4) at ($(\B:{\a/\c*\l}) + (O4)$);
  \filldraw[fill=gray, draw=black, rounded corners=0.01mm] (O4) -- (A4) -- ($(O4) + (\l, 0)$) -- ++(0, \l) -- ($(A4) + (0, \l)$) -- ($(O4) + (0, \l)$) -- cycle;
  \template{(5, -12)};
  \coordinate (O5) at (15, -12);
  \filldraw[fill=gray, draw=black] (O5) rectangle +(5, 5);
  \template{(15, -12)};
\end{tikzpicture}
\end{document}

PWWs-01-02

The Pythagorean Theorem II

PWWs-01-02
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \foreach \i in {0, 2}{
    \begin{scope}[rotate around={90*\i:(-3.5, 2.5)}]
      \coordinate (O1) at (-1, 0);
      \coordinate (P0) at ($(O1)+(-5, 0)$);
      \coordinate (P1) at ($(O1)+(-9/5, 12/5)$);
      \draw[fill=gray, rounded corners=0.01mm] (O1) -- (P0) -- (P1) -- (O1) -- cycle;
    \end{scope}
  }
  \foreach \i in {1, 3}{
    \begin{scope}[rotate around={90*\i:(-3.5, 2.5)}]
      \coordinate (O1) at (-1, 0);
      \coordinate (P0) at ($(O1)+(-5, 0)$);
      \coordinate (P1) at ($(O1)+(-9/5, 12/5)$);
      \draw[fill=lightgray, rounded corners=0.01mm] (O1) -- (P0) -- (P1) -- (O1) -- cycle;
    \end{scope}
  }
  \draw (O1) -- ($(O1)+(0, 5)$) -- ($(O1)+(5, 5)$) -- ($(O1)+(5, 0)$) -- (O1) -- cycle;
  \coordinate (O2) at (1, 0);
  \coordinate (Q11) at ($(O2)+(5, 0)$);
  \coordinate (Q12) at ($(O2)+(0, 3)$);
  \filldraw[fill=gray, draw=black] (Q11) rectangle (Q12);
  \draw (Q11) -- (Q12);
  \coordinate (Q22) at ($(Q11)+(3, 4)$);
  \filldraw[fill=lightgray, draw=black] (Q11) rectangle (Q22);
  \draw (Q11) -- (Q22);
  \coordinate (Q31) at ($(Q11)+(0, 4)$);
  \coordinate (Q32) at ($(Q31)+(-1, -1)$);
  \draw (Q31) rectangle (Q32);
\end{tikzpicture}
\end{document}

PWWs-01-01

The Pythagorean Theorem I

PWWs-01-01
\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[line width=1pt]
  \coordinate (O1) at (-1, 0);
  \coordinate (P11) at ($(O1)+(0, 4)$);
  \coordinate (P12) at ($(O1)+(-1, 1)$);
  \coordinate (P21) at ($(O1)+(-4, 1)$);
  \coordinate (P22) at ($(O1)+(-1, 0)$);
  \filldraw[fill=lightgray, draw=black] (P11) rectangle (P12);
  \filldraw[fill=gray, draw=black] (P21) rectangle (P22);
  \draw (O1) rectangle ($(O1)+(-4, 4)$);
  \draw (P11) -- (P12);
  \draw (P21) -- (P22);
  \foreach \i in {0, 2}{
    \begin{scope}[rotate around={90*\i:(3, 2)}]
      \coordinate (O2) at (1, 0);
      \coordinate (Q0) at ($(O2)+(3, 0)$);
      \coordinate (Q1) at ($(O2)+(0, 1)$);
      \draw[fill=gray] (O2) -- (Q0) -- (Q1) -- (O2) -- cycle;
    \end{scope}
  }
  \foreach \i in {1, 3}{
    \begin{scope}[rotate around={90*\i:(3, 2)}]
      \coordinate (O2) at (1, 0);
      \coordinate (Q0) at ($(O2)+(3, 0)$);
      \coordinate (Q1) at ($(O2)+(0, 1)$);
      \draw[fill=lightgray] (O2) -- (Q0) -- (Q1) -- (O2) -- cycle;
    \end{scope}
  }
\end{tikzpicture}
\end{document}