TikZ PGF – How to Create Shaded Triangles

tikz-cdtikz-pgf

enter image description here

How to shade a right triangle like in the picture?

Here's my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{intersections}
\usepackage{amsmath}
\usepackage{siunitx}
\sisetup{output-decimal-marker={,}}

\begin{document}

\begin{tikzpicture}[scale=2]
\coordinate [label=left:$\textcolor{white}A$] (A) at (1cm,-3cm);
\coordinate [label=below:$\textcolor{white}B$] (B) at (1cm,1cm);
\coordinate [label=below:$\textcolor{white}C$] (C) at (-4cm,1cm);
\node at (-3.4cm, .85cm) {$\textcolor{blue}{38^\circ}$};
\tkzMarkAngle[size=0.4cm,color=black,mark=](A,C,B)
\tkzMarkRightAngle[draw=red,size=.2](C,B,A);
\draw [thick=black] (A) -- node[right] {$\textrm{\textcolor{blue}{11}}$} (B) -- node[sloped,above] {$\textrm{\textcolor{blue}{x}}$} (C) -- node[sloped, above] {$\textrm{\textcolor{white}{hypotenuse = 82}}$} (A);
\end{tikzpicture}

\end{document}

Don't mind the text's in white; I use it when it's needed.

Best Answer

Another option. Only with TikZ and its library angles.

Then there is something wrong with the numbers, so I'm letting TikZ do the math for me.

This is the code:

\documentclass[border=6mm]{standalone}
\usepackage    {siunitx}
\usepackage    {tikz}
\usetikzlibrary{angles}
\sisetup       {output-decimal-marker={,}}

\begin{document}
\begin{tikzpicture}[scale=0.5,line join=round]
\def\yb{11}
\def\ac{38} % angle C
\pgfmathsetmacro\x{\yb/tan(\ac)}
\pgfmathsetmacro\h{\yb/sin(\ac)} % hypothenuse
\coordinate (A) at (0,0);
\coordinate (B) at (0,-\yb);
\coordinate (C) at (-\x,0);
\draw[thick,fill=blue!20] (A) -- node[right]        {\color{blue}$\yb$}
                          (B) -- node[sloped,above] {\color{white}hypotenuse = \num{\h}}
                          (C) -- node[sloped,above] {\color{blue}$x$} cycle;
% angles, with angles library
\draw[thick] pic [draw] {angle=B--C--A} node [below,xshift=1cm] at (C) {\ang{\ac}};
\draw[thick] pic [draw,angle radius=3mm] {right angle=B--A--C};
\end{tikzpicture}
\end{document}

An the output: enter image description here