mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
added vector triangle inequality
This commit is contained in:
parent
dd8dd8921e
commit
1cc5c656b2
2 changed files with 54 additions and 0 deletions
31
tikz/vector-triangle-inequality/Makefile
Normal file
31
tikz/vector-triangle-inequality/Makefile
Normal file
|
@ -0,0 +1,31 @@
|
|||
SOURCE = vector-triangle-inequality
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
WIDTH = 500
|
||||
|
||||
make:
|
||||
pdflatex $(SOURCE).tex -output-format=pdf
|
||||
make clean
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGET) *.class *.html *.log *.aux
|
||||
|
||||
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:
|
||||
#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
|
|
@ -0,0 +1,23 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{shapes, calc, shapes, arrows}
|
||||
\usepackage{amsmath,amssymb}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}[]
|
||||
% Punkte
|
||||
\coordinate (A) at (0,0) {};
|
||||
\coordinate (B) at (5,0) {};
|
||||
\coordinate (C) at (2,2) {};
|
||||
|
||||
% Draw the triangle
|
||||
\path[fill=blue!10, fill=blue!10] (A) -- (B) -- (C) -- (A);
|
||||
\draw[->, very thick,fill=gray!10, green!80, arrows={-latex}] (A) -- (C) node[sloped,midway,above] {$x$};
|
||||
\draw[->, very thick,fill=gray!10, blue!80, arrows={-latex}] (C) -- (B) node[sloped,midway,above] {$y$};
|
||||
\draw[->, very thick,fill=gray!10, red!80, arrows={-latex}] (A) -- (B) node[sloped,midway,above] {$z = x + y$};
|
||||
\coordinate (A) -- (B) node[sloped,midway,below] {$\|z\| = \|x+y\| \leq \|x\| + \|y\|$};
|
||||
|
||||
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue