I need to draw the proof of Pythagoras (Bhaskara’s Proof) (see pic below). I am still quite new to latex and don't know a lot about the tikz package.

This is Bhaskara's Proofe

I started with the square but now I am stuck and don't know how to proceed. (the (not) diagonals are difficult for me)

How can I do this efficiently?


  • 2
    Use GeoGebra and export the result in TikZ. This can be the first step to produce a MWE.
    – projetmbc
    Mar 9, 2021 at 22:15

4 Answers 4


picture for proof of pythagoras

Here's How I would do the basic shape, I'll leave the labels to you.


        \draw (0, 0) rectangle (8, 8);
        \node[rotate=34.8, minimum size=2cm] (S) at (4, 4) {};
        \draw (0, 0) -- (S.south east);
        \draw (0, 8) -- (S.south west);
        \draw (8, 0) -- (S.north east);
        \draw (8, 8) -- (S.north west);

Here's how it works. First draw the outer box. Then draw a node, S in the middle, the default node shape is square. Connect the corners of this node to corners of the outer square but going one corner anticlockwise so top left of the outer box goes to bottom left of the inner box etc. Then rotate the node. There are two ways to do this, trial and error, try angles until everything lines up nicely, or maths.

Maths for those interested

Let d be the length of the side of the inner box, c is the length of the side of the outer box.

Then looking at the diagram we see d = a - b taking a as the longer of the two non-hypotenuse sides of the triangle.

Then we look at the triangles and notice that the angle in the bottom left from the horizontal to the almost diagonal is the same as the angle of the inner square, call this angle theta.

Applying trig definitions we know that b/c = sin(theta) and a/c = cos(theta). Hence (b - a)/c = sin(theta) - cos(theta) = d/c.

Since d and c are known (I arbitrarily chose 8 cm and 2 cm) we just need to find theta, this can be done with trig identities, or like I did, ask wolfram alpha. The answers it gives are not necessarily immediately correct, for example I had to subtract 180 degrees before I got the answer of 34.8 degrees.

  • 1
    Thanks! That solution worked well for me :)
    – choco_lion
    Mar 10, 2021 at 0:20
  • Mathematically this just uses (a - b)^2 + 4 * ab / 2.
    – projetmbc
    Aug 13, 2021 at 19:23

Your question title asks for a LaTeX solution, so let me propose an alternative using MetaPost ❤️:

%#1 size, #2 angle 
%(the triangle will have #2/2 as its least angle)
vardef Bhaskara(expr u, v) =
    for i = 1 upto 4:
    %Triangles in a semi-circle are right-angled
    draw (right -- dir v -- left -- cycle)
        %So right angles are inner to the square
        %Triangles at each side
        rotated (90i-90) shifted (dir 90i)
        scaled (u/2);
draw Bhaskara(\the\dimexpr#1\relax,\the\numexpr#2\relax);

enter image description here


Yet another tikz approach, parametrized and drawing "only one line".


\begin{tikzpicture}[line join=round]
% Triangle information
\def\b{4} % catheti, b>c
\pgfmathsetmacro\B{atan(\c/\b)}       % acute angle
\pgfmathsetmacro\a{sqrt(\b*\b+\c*\c)} % hypotenuse
\foreach\i in {0,90,180,270}
    \begin{scope}[rotate=\i, shift={(-0.5*\a,-0.5*\a)}]
      \draw (0:\a) -- (0,0) -- (\B:\b);

enter image description here

  • nice! thanks :)
    – choco_lion
    Mar 10, 2021 at 23:26

Yet another TikZ way with geometric transformations of pics, and also just one command \path.

enter image description here

\begin{tikzpicture}[join=round,declare function={c=2;},
righttriangle/.pic={\draw[magenta] (180:c)--(0:c)--(70:c)--cycle;}]
(0,0)   pic{righttriangle}
(0,2*c) pic[scale=-1]{righttriangle}
(0,0)   pic[shift={(c,c)},rotate=90]{righttriangle}
(0,0)   pic[shift={(-c,c)},rotate=-90]{righttriangle};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.