1

I have made a square and have a diagonal along the middle. I want to label the bottom side, right side, and the diagonal to show the Pythagorean identity. So the sides should be, 1,1, and square root respectively. How would I add this in the code?

\begin{tikzpicture}
    \draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0) ;
    \draw (0,0) -- (4,4);
\end{tikzpicture}

1 Answer 1

2

enter image description here

\begin{tikzpicture}
    \draw (0,0) -- node[below, pos=.5]{1}(4,0) -- node[right, pos=.5]{1}(4,4) -- (0,4) -- (0,0) ;
    \draw (0,0) -- node[left, pos=.5, sloped, above]{$\sqrt{2}$}(4,4);
\end{tikzpicture}
2
  • 1
    I love you bro thank you.
    – Rudy Myers
    May 30, 2021 at 14:51
  • would you like to accept and upvote the answer if it met the requirement
    – js bibra
    May 30, 2021 at 15:18

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.