2012-09-14 19:59:14 +02:00
|
|
|
\documentclass[varwidth=true, border=2pt]{standalone}
|
|
|
|
\usepackage{tikz}
|
|
|
|
\usetikzlibrary{shapes, calc, shapes, arrows}
|
|
|
|
\usepackage{amsmath,amssymb}
|
|
|
|
|
2012-09-16 19:40:09 +02:00
|
|
|
\usepackage{xcolor}
|
|
|
|
\definecolor{xvectorcolor}{HTML}{77933C}
|
|
|
|
|
2012-09-14 19:59:14 +02:00
|
|
|
\begin{document}
|
2012-09-17 07:05:02 +02:00
|
|
|
\begin{tikzpicture}[font=\boldmath]
|
|
|
|
\large
|
|
|
|
|
|
|
|
% Points
|
2012-09-14 19:59:14 +02:00
|
|
|
\coordinate (A) at (0,0) {};
|
|
|
|
\coordinate (B) at (5,0) {};
|
|
|
|
\coordinate (C) at (2,2) {};
|
|
|
|
|
|
|
|
% Draw the triangle
|
2012-09-16 21:22:04 +02:00
|
|
|
\path[fill=blue!10, fill=blue!5] (A) -- (B) -- (C) -- (A);
|
2012-09-17 19:54:27 +02:00
|
|
|
\draw[ultra thick, xvectorcolor, arrows={-latex}] (A) -- (C) node[sloped,midway,above=-0.1cm] {$x$};
|
|
|
|
\draw[ultra thick, blue!80, arrows={-latex}] (C) -- (B) node[sloped,midway,above=-0.1cm] {$y$};
|
|
|
|
\draw[ultra thick, red!80, arrows={-latex},line cap=round] (A) -- (B) node[sloped,midway,right=-0.3cm,above=-0.1cm] {$x+y$};
|
2012-09-14 19:59:14 +02:00
|
|
|
\end{tikzpicture}
|
|
|
|
\end{document}
|