2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 06:18:05 +02:00
This commit is contained in:
Martin Thoma 2013-02-13 20:26:49 +01:00
parent 7c4cef9698
commit ee468b23dc
9 changed files with 225 additions and 43 deletions

View file

@ -1,8 +1,8 @@
DOKUMENT = tutorenschulung-abschlussreflexion
make:
pdflatex -shell-escape $(DOKUMENT).tex -output-format=pdf
pdflatex -shell-escape $(DOKUMENT).tex -output-format=pdf
pdflatex $(DOKUMENT).tex -output-format=pdf
pdflatex $(DOKUMENT).tex -output-format=pdf
make clean
clean:

View file

@ -32,22 +32,6 @@
\definecolor{greencomments}{rgb}{0,0.5,0}
\definecolor{redstrings}{rgb}{0.9,0,0}
\lstset{
language=[Sharp]C,
columns=flexible, % needed because of spaces
keepspaces=true, % needed because of spaces
showspaces=false,
showtabs=false,
breaklines=true,
showstringspaces=false,
breakatwhitespace=true,
escapeinside={(*@}{@*)},
commentstyle=\color{greencomments},
keywordstyle=\color{bluekeywords}\bfseries,
stringstyle=\color{redstrings},
basicstyle=\small\ttfamily
}
% doch lieber nicht:
% http://stackoverflow.com/a/6295698/562769
%\lstset{prebreak=\raisebox{0ex}[0ex][0ex]
@ -67,8 +51,6 @@
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\makeglossary
%% -------------------------------
%% | Declarations |
%% -------------------------------
@ -86,13 +68,6 @@
\clearpage{\pagestyle{empty}\cleardoublepage}
}
% new page before section
%\let\stdsection\section
%\renewcommand\section{\newpage\stdsection}
%\newcommand{\sectionbreak}{\clearpage}
%% --- End of New Commands ---
%% -------------------------------
%% | Globale Settings |
%% -------------------------------
@ -126,8 +101,3 @@
&\begin{minipage}[t][][t]{8cm}
\begin{enumerate} #2 \end{enumerate}
\end{minipage}\\ }
\newenvironment{usecase}{\tabularhead}
{\hline\end{tabular}}
\usepackage{listings}

View file

@ -59,7 +59,7 @@
\EndFunction
\\
\Function{Relabel}{Node $v$}
\If{$\Set{w|r_f(v,w) > 0} == \emptyset$}
\If{$\Set{w \in V |r_f(v,w) > 0} == \emptyset$}
\State $dist(v) \gets \infty$
\Else
\State $dist(v) \gets \min\Set{dist(w)+1|w \in V: r_f(v,w) > 0}$

View file

@ -1,16 +1,6 @@
def writeCoordinates(file, x, y, z):
file.write("(" + str(x) + "," + str(y) + "," + str(z) + ") ")
def createTex(x, y, z, output='3d-manhattan-bar-plot.tex'):
template = open('template.tpl', 'r').read()
make3dhistogram(x, y, z, 0.0, 'data')
data = open('data', 'r').read()
file = open(output, 'wb')
template = template.replace('[PLACE_PLOT_HERE]', data)
template = template.replace('[XMAX]', str(len(x)-1))
template = template.replace('[YMAX]', str(len(y)-1))
file.write(template)
def make3dhistogram(x, y, z, zmin, output):
file = open(output, 'wb')
i = 0
@ -37,6 +27,16 @@ def make3dhistogram(x, y, z, zmin, output):
writeCoordinates(file, x[i], y[j], zmin)
writeCoordinates(file, x[i], y[j], zmin)
def createTex(x, y, z, output='3d-manhattan-bar-plot.tex'):
template = open('template.tpl', 'r').read()
make3dhistogram(x, y, z, 0.0, 'data')
data = open('data', 'r').read()
file = open(output, 'wb')
template = template.replace('[PLACE_PLOT_HERE]', data)
template = template.replace('[XMAX]', str(len(x)-1))
template = template.replace('[YMAX]', str(len(y)-1))
file.write(template)
if __name__ == "__main__":
x = [0,1,2,3,4] # Whats that good for? Can it be replaced by range(xMax+1)?
y = [0,1,2,3,4] # Whats that good for? Can it be replaced by range(yMax+1)?

View file

@ -0,0 +1,35 @@
SOURCE = triangle-angles
DELAY = 80
DENSITY = 300
WIDTH = 500
make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
gif:
pdfcrop $(SOURCE).pdf
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
png:
make
make svg
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
transparentGif:
convert $(SOURCE).pdf -transparent white result.gif
make clean
svg:
make
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
pdf2svg $(SOURCE).pdf $(SOURCE).svg
# Necessary, as pdf2svg does not always create valid svgs:
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
rm $(SOURCE)2.svg

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="499pt"
height="207pt"
viewBox="0 0 499 207"
id="svg2">
<defs
id="defs43" />
<g
id="surface0">
<path
d="M 7.04409e-4,0.00145621 85.039682,49.098512 113.38713,0.00145621 l -113.386425591,0 z m 0,0"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path5"
style="fill:#f3f3f3;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="m 80.636719,168.3125 c -0.109375,-0.29297 -0.179688,-0.47266 -0.542969,-0.47266 -0.363281,0 -0.4375,0.14453 -0.546875,0.47266 l -4.800781,13.875 c -0.4375,1.20312 -1.34375,1.56641 -2.617188,1.56641 l 0,0.73046 c 0.542969,-0.0352 1.5625,-0.0742 2.363282,-0.0742 0.726562,0 1.925781,0.0391 2.691406,0.0742 l 0,-0.73046 c -1.164063,0 -1.746094,-0.58204 -1.746094,-1.16407 0,-0.0742 0.03516,-0.32812 0.03516,-0.36328 l 1.09375,-3.02344 5.707032,0 1.238281,3.53125 c 0.03516,0.10938 0.07031,0.25782 0.07031,0.32813 0,0.69141 -1.308593,0.69141 -1.925781,0.69141 l 0,0.73046 c 0.835938,-0.0742 2.472656,-0.0742 3.34375,-0.0742 0.984375,0 2.074219,0.0391 3.019531,0.0742 l 0,-0.73046 -0.398437,0 c -1.382813,0 -1.710938,-0.14454 -1.964844,-0.91016 L 80.636719,168.3125 z m -1.234375,2.58594 2.617187,7.57422 -5.199219,0 2.582032,-7.57422 z m 0,0"
id="path7"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 340.94531,175.96094 0,-5.6836 c 0,-0.80078 0.0391,-0.94531 1.12891,-0.94531 l 2.87109,0 c 2.25781,0 3.05469,1.96875 3.05469,3.20703 0,1.49219 -1.125,3.42188 -3.70703,3.42188 l -3.34766,0 z m 5.45703,0.21875 c 2.25391,-0.4375 3.85547,-1.92969 3.85547,-3.64063 0,-2.0039 -2.14844,-3.93359 -5.16406,-3.93359 l -8.47656,0 0,0.72656 0.54687,0 c 1.78125,0 1.85547,0.25391 1.85547,1.09375 l 0,12.23828 c 0,0.83594 -0.0742,1.08985 -1.85547,1.08985 l -0.54687,0 0,0.73046 9.09375,0 c 3.08984,0 5.16406,-2.07812 5.16406,-4.26171 0,-2.00391 -1.89063,-3.75 -4.47266,-4.04297 z m -1.41797,7.57422 -2.91015,0 c -1.08985,0 -1.12891,-0.14454 -1.12891,-0.91016 l 0,-6.33594 4.36328,0 c 2.29297,0 3.27344,2.14844 3.27344,3.71485 0,1.64062 -1.23437,3.53125 -3.59766,3.53125 z m 0,0"
id="path9"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 270.95703,28.882812 c 0,4.808594 3.74219,8.453126 8.07031,8.453126 3.78516,0 6.03907,-3.242188 6.03907,-5.9375 0,-0.21875 0,-0.402344 -0.29297,-0.402344 -0.25391,0 -0.25391,0.144531 -0.28907,0.402344 -0.18359,3.3125 -2.65625,5.207031 -5.20312,5.207031 -1.41797,0 -5.96094,-0.765625 -5.96094,-7.722657 0,-6.917968 4.54297,-7.71875 5.96094,-7.71875 2.51172,0 4.58594,2.109376 5.05859,5.496094 0.0352,0.328125 0.0352,0.402344 0.36328,0.402344 0.36329,0 0.36329,-0.07422 0.36329,-0.546875 l 0,-5.5 c 0,-0.398437 0,-0.582031 -0.25391,-0.582031 -0.0742,0 -0.18359,0 -0.36719,0.292968 l -1.16015,1.710938 c -0.83985,-0.839844 -2.03907,-2.003906 -4.25782,-2.003906 -4.36328,0 -8.07031,3.714844 -8.07031,8.449218 z m 0,0"
id="path11"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 209.62109,173.55078 c 0,-3.78906 1.89063,-4.77344 3.125,-4.77344 0.21875,0 1.67188,0.0352 2.47266,0.875 -0.94531,0.0742 -1.08984,0.76563 -1.08984,1.05469 0,0.62109 0.4375,1.05859 1.05468,1.05859 0.61719,0 1.08985,-0.36718 1.08985,-1.09375 0,-1.5664 -1.78125,-2.47656 -3.5625,-2.47656 -2.91016,0 -5.01953,2.51172 -5.01953,5.39063 0,2.98828 2.29296,5.28125 4.98437,5.28125 3.08984,0 3.85156,-2.80469 3.85156,-3.02344 0,-0.21875 -0.2539,-0.21875 -0.32422,-0.21875 -0.18359,0 -0.25781,0.0742 -0.29296,0.21875 -0.65235,2.14844 -2.17969,2.44141 -3.01954,2.44141 -1.23437,0 -3.26953,-0.98438 -3.26953,-4.73438 z m 0,0"
id="path13"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 176.61719,85.273438 0,-7.359376 -3.34766,0.253907 0,0.730469 c 1.63672,0 1.82031,0.144531 1.82031,1.3125 l 0,13.839843 0.58203,0 c 0,-0.03906 0.17969,-0.363281 0.83594,-1.457031 0.32813,0.546875 1.3086,1.710938 3.01563,1.710938 2.76562,0 5.16406,-2.292969 5.16406,-5.28125 0,-2.949219 -2.25391,-5.246094 -4.90625,-5.246094 -1.82031,0 -2.80078,1.09375 -3.16406,1.496094 z m 0.0703,6.117187 0,-4.769531 c 0,-0.4375 0,-0.476563 0.25781,-0.839844 0.90625,-1.3125 2.17969,-1.492188 2.72656,-1.492188 1.05469,0 1.89063,0.617188 2.4336,1.492188 0.62109,0.949219 0.65625,2.257812 0.65625,3.242188 0,0.835937 -0.0352,2.222656 -0.69141,3.277343 -0.50781,0.730469 -1.38281,1.492188 -2.61719,1.492188 -1.05468,0 -1.89062,-0.542969 -2.4375,-1.417969 -0.32812,-0.472656 -0.32812,-0.546875 -0.32812,-0.984375 z m 0,0"
id="path15"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 320.77344,94.523438 c 0.10937,0.914062 0.72656,1.894531 1.82031,1.894531 0.50781,0 1.92578,-0.328125 1.92578,-2.21875 l 0,-1.3125 -0.58203,0 0,1.3125 c 0,1.347656 -0.58203,1.492187 -0.83594,1.492187 -0.76562,0 -0.87109,-1.058594 -0.87109,-1.167968 l 0,-4.625 c 0,-0.980469 0,-1.894532 -0.83985,-2.765626 -0.90625,-0.910156 -2.07031,-1.277343 -3.16406,-1.277343 -1.92578,0 -3.52734,1.09375 -3.52734,2.625 0,0.691406 0.47265,1.089843 1.09375,1.089843 0.65234,0 1.05469,-0.472656 1.05469,-1.054687 0,-0.292969 -0.10938,-1.054687 -1.20313,-1.054687 0.65625,-0.839844 1.78516,-1.09375 2.51172,-1.09375 1.16406,0 2.47266,0.910156 2.47266,2.984374 l 0,0.839844 c -1.19922,0.07422 -2.80079,0.144532 -4.25391,0.835938 -1.74609,0.800781 -2.32813,2.003906 -2.32813,3.023437 0,1.894531 2.25391,2.476563 3.70704,2.476563 1.52734,0 2.58203,-0.945313 3.01953,-2.003906 z m -0.14453,-3.824219 0,2.332031 c 0,2.1875 -1.67188,2.988281 -2.72657,2.988281 -1.1289,0 -2.07422,-0.800781 -2.07422,-1.96875 0,-1.273437 0.98047,-3.203125 4.80079,-3.351562 z m 0,0"
id="path17"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 7.04409e-4,0.00145621 21.261422591,0 c 0,3.73016279 -0.985195,7.39832379 -2.851528,10.62744579"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path19"
style="fill:#b3b3ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="m 116.30078,149.53516 c 0,-3.64454 -2.14453,-4.77344 -3.85547,-4.77344 -3.19922,0 -6.2539,3.3164 -6.2539,6.59375 0,2.18359 1.38281,3.93359 3.78125,3.93359 1.45703,0 3.1289,-0.54687 4.875,-1.96875 0.28906,1.23828 1.05468,1.96875 2.10937,1.96875 1.23438,0 1.96094,-1.27734 1.96094,-1.64062 0,-0.17969 -0.14453,-0.25391 -0.28906,-0.25391 -0.14453,0 -0.21875,0.0742 -0.28907,0.25391 -0.4375,1.1289 -1.27343,1.1289 -1.3125,1.1289 -0.72656,0 -0.72656,-1.82031 -0.72656,-2.36718 0,-0.47266 0,-0.54688 0.25391,-0.80079 2.18359,-2.76953 2.65625,-5.46484 2.65625,-5.46484 0,-0.0703 -0.0352,-0.25391 -0.29297,-0.25391 -0.21484,0 -0.21484,0.0742 -0.32422,0.51172 -0.4375,1.45703 -1.20312,3.20313 -2.29297,4.58985 l 0,-1.45703 z m -1.52734,3.20312 c -2.07031,1.78516 -3.85547,2.03906 -4.76172,2.03906 -1.38281,0 -2.10938,-1.05468 -2.10938,-2.54687 0,-1.13281 0.61719,-3.64453 1.34375,-4.8086 1.08985,-1.71484 2.36329,-2.14843 3.16407,-2.14843 2.29297,0 2.29297,3.05859 2.29297,4.84375 0,0.875 0,2.22265 0.0703,2.62109 z m 0,0"
id="path21"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 113.38713,0.00145621 -14.172047,0 c 0,5.06236379 2.698797,9.74098779 7.086027,12.27300679"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path23"
style="fill:#b3ffb3;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="m 330.17187,140.96484 c 0,-1.74609 -1.27343,-3.16797 -3.16406,-3.16797 -1.34375,0 -2,0.36329 -2.80078,0.94532 -1.27344,0.94922 -2.54297,3.20703 -2.98047,4.95312 l -3.71094,14.75391 c 0,0.10937 0.10938,0.2539 0.29297,0.2539 0.17969,0 0.25391,-0.0742 0.25391,-0.10937 l 1.63672,-6.44531 c 0.43359,1.41797 1.45312,2.25781 3.16406,2.25781 1.67188,0 3.41797,-0.80078 4.47266,-1.82031 1.125,-1.0586 1.85547,-2.55078 1.85547,-4.26172 0,-1.67578 -0.875,-2.91406 -1.71094,-3.46094 1.34765,-0.80078 2.6914,-2.22266 2.6914,-3.89844 z m -4.18359,3.86328 c -0.28906,0.10547 -0.54297,0.14454 -1.125,0.14454 -0.32812,0 -0.76562,0.0352 -1.01953,-0.0742 0.0742,-0.25391 0.91016,-0.17969 1.16406,-0.17969 0.47266,0 0.69141,0 0.98047,0.10937 z m 2.875,-4.41015 c 0,1.64062 -0.875,3.3164 -2.07422,4.04297 -0.65234,-0.25391 -1.08984,-0.28907 -1.78125,-0.28907 -0.50781,0 -1.8164,-0.0391 -1.8164,0.72657 0,0.65625 1.19921,0.58203 1.59765,0.58203 0.875,0 1.23828,0 1.92969,-0.28906 0.87109,0.83593 0.98047,1.5664 1.01562,2.62109 0.0391,1.34766 -0.50781,3.09766 -1.16406,4.00781 -0.90625,1.23828 -2.47265,2.07422 -3.78125,2.07422 -1.78125,0 -2.65625,-1.34766 -2.65625,-2.98437 0,-0.21875 0,-0.58594 0.10938,-1.01954 l 1.49218,-5.86718 c 0.50782,-2 2.1836,-5.71875 4.98438,-5.71875 1.34375,0 2.14453,0.73047 2.14453,2.11328 z m 0,0"
id="path25"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="M 85.039682,49.098512 72.76586,42.011873 c 3.913928,-6.779982 12.58264,-9.100861 19.363201,-5.186368"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path27"
style="fill:#ffb3b3;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="m 265.71875,61.566406 c 0.91016,-2.660156 3.45703,-2.695312 3.71094,-2.695312 3.49218,0 3.74609,4.078125 3.74609,5.898437 0,1.421875 -0.10937,1.824219 -0.29297,2.296875 -0.50781,1.675782 -1.19922,4.371094 -1.19922,4.988282 0,0.253906 0.10938,0.402343 0.29297,0.402343 0.32422,0 0.50781,-0.511719 0.76172,-1.386719 0.54688,-1.964843 0.76563,-3.277343 0.83594,-4.003906 0.0742,-0.292968 0.10937,-0.582031 0.21875,-0.910156 0.72656,-2.296875 2.21875,-5.757812 3.1289,-7.578125 0.17969,-0.289063 0.4375,-0.800781 0.4375,-0.910156 0,-0.21875 -0.21875,-0.21875 -0.25781,-0.21875 -0.0703,0 -0.21484,0 -0.28906,0.144531 -1.19922,2.222656 -2.14453,4.554688 -3.05469,6.886719 -0.0351,-0.691407 -0.0351,-2.476563 -0.94531,-4.734375 -0.58203,-1.421875 -1.49219,-2.550782 -3.09375,-2.550782 -2.90625,0 -4.54297,3.53125 -4.54297,4.261719 0,0.21875 0.21875,0.21875 0.47266,0.21875 l 0.0703,-0.109375 z m 0,0"
id="path29"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<path
d="m 113.38713,0.00145621 14.1754,0 c 0,2.48677579 -0.65624,4.93333379 -1.90158,7.08496379"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path31"
style="fill:#b3b3ff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="M 113.38713,0.00145621 125.66095,7.08642 c -3.91561,6.778306 -12.58264,9.102536 -19.35984,5.188043"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path33"
style="fill:#ffb3b3;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
<path
d="M 88.727032,-14.175174 173.76601,34.926909"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path35"
style="fill:none;stroke:#ff0000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:2.98883, 2.98883" />
<path
d="m -28.348419,0.00145621 198.430439,0"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path37"
style="fill:none;stroke:#ff0000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:2.98883, 2.98883" />
<path
d="M 7.04409e-4,0.00145621 85.039682,49.098512 113.38713,0.00145621 l -113.386425591,0"
transform="matrix(2.327425,0,0,-2.331081,80.096017,159.9448)"
id="path39"
style="fill:none;stroke:#000000;stroke-width:0.79701;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,79 @@
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usetikzlibrary{shapes, calc, shapes,snakes}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{preview}
\begin{tikzpicture}[thick]
\newcommand\XC{4}
\newcommand\ALPHA{30}
\newcommand\XB{{(\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5}}
\newcommand\YB{{sqrt(cos(\ALPHA)*\XC*cos(\ALPHA)*\XC - (\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5*(\XC*(cos(\ALPHA)*cos(\ALPHA) - sin(\ALPHA)*sin(\ALPHA)) + \XC)*0.5)}}
\newcommand\XBo{{(\XB)+4}}
\newcommand\YBo{{\YB}}
\newcommand\XBp{{\XB*0.5}}
\newcommand\YBp{{\YB*0.5}}
% Draw the triangle
\draw[fill=gray!10] (0, 0) coordinate (A)
-- (\XB,\YB) coordinate (C)
-- (\XC, 0) coordinate (B)
-- (0, 0) -- cycle;
% Draw nodes
\node at (A)[anchor=north] {A};
\node at (B)[anchor=north] {B};
\node at (C)[anchor=south] {C};
% Draw edge text
\node (c) at ($(A)!0.5!(B)$) [below] {c};
\node (b) at ($(A)!0.5!(C)$) [above] {b};
\node (a) at ($(B)!0.6!(C)$) [right] {a};
% draw alpha
\draw[fill=blue!30] (0,0) -- (0:0.75cm) arc (0:\ALPHA:.75cm);
\coordinate[label=right:$\alpha$] (Alpha) at (0.25,0.15);
% draw beta
\begin{scope}[shift={(\XC, 0)}]
\draw[fill=green!30] (0,0) -- (-180:0.50cm) arc (180:{180-(90-\ALPHA)}:0.5cm);
\draw (150:0.35cm) node {$\beta$};
\end{scope}
% draw gamma
\begin{scope}[shift={(\XB, \YB)}]
\draw[fill=red!30] (0,0) -- ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
\draw (-0.1, -0.05) node[below] {$\gamma$};
\end{scope}
% shifted alpha
\begin{scope}[shift={(4,0)}]
\path[fill=blue!30] (0,0) -- (0:0.5cm) arc (0:\ALPHA:.5cm);
\draw (0:0.5cm) arc (0:\ALPHA:.5cm);
\end{scope}
% shifted gamma
\begin{scope}[shift={(4, 0)},rotate=180]
\path[fill=red!30] (0,0) -- ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
\draw ({180+\ALPHA}:0.5cm) arc ({180+\ALPHA}:{180+\ALPHA+90}:0.5cm);
\end{scope}
\begin{scope}[shift={(3.13,-0.5)}]
\draw[dashed, red] (0, 0) -- (\XB,\YB);
\end{scope}
\draw[dashed, color=red] (-1, 0) -- (6, 0);
\draw (0, 0) coordinate (X)
-- (\XB,\YB) coordinate (Y)
-- (\XC, 0) coordinate (Z)
-- (0, 0);
\end{tikzpicture}
\end{preview}
\end{document}