2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

added vector addition and scaling example

This commit is contained in:
Martin Thoma 2012-09-16 21:51:57 +02:00
parent 093b57df72
commit ab9470c4f5
3 changed files with 70 additions and 0 deletions

View file

@ -66,6 +66,11 @@ e^x &= \sum_{n = 0}^{\infty} \frac {x^n}{n!} \\
\end{align*}
\section{Ableitungen}
\begin{align*}
(\log x)' &= \frac{1}{x}
\end{align*}
\begin{table}[ht]
\begin{minipage}[b]{0.5\linewidth}\centering
\begin{align*}

View file

@ -0,0 +1,31 @@
SOURCE = vector-addition-and-scaling
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

View file

@ -0,0 +1,34 @@
\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, calc, shapes, arrows}
\usepackage{amsmath,amssymb}
\usepackage{xcolor}
\definecolor{xvectorcolor}{HTML}{77933C}
\begin{document}
\begin{tikzpicture}[font=\boldmath]\large
% Punkte
\coordinate (A) at (0,0) {};
\coordinate (B) at (2,0) {};
\coordinate (C) at (1,1) {};
\coordinate (D) at (3,1) {};
% Draw the triangle
\draw[thick, blue!25] (B) -- (D) node[sloped,midway,above] {};
\draw[thick, red!25] (C) -- (D) node[sloped,midway,above] {};
\draw[->, ultra thick, red, arrows={-latex}] (A) -- (B) node[sloped,right=-0.3cm, above] {$\mathsf{w}$};
\draw[->, ultra thick, blue, arrows={-latex}] (A) -- (C) node[sloped,midway,above=-0.1cm] {$\mathsf{v}$};
\draw[->, ultra thick, black, arrows={-latex}] (A) -- (D) node[sloped,midway,above=-0.1cm] {$\mathsf{v+w}$};
\begin{scope}[shift={(0,1.5)}]
\draw[thick, blue!25] (4,0) -- (5,1) node[sloped,midway,above] {};
\draw[thick, red!25] (1,1) -- (5,1) node[sloped,midway,above] {};
\draw[->, ultra thick, red!25, arrows={-latex}] (0,0) -- (2,0);
\draw[->, ultra thick, red, arrows={-latex}] (0,0) -- (4,0) node[sloped,right=-0.7cm,above] {$\mathsf{2 \cdot w}$};
\draw[->, ultra thick, blue, arrows={-latex}] (0,0) -- (1,1) node[sloped,midway,above=-0.1cm] {$\mathsf{v}$};
\draw[->, ultra thick, black, arrows={-latex}] (0,0) -- (5,1) node[sloped,midway,above=-0.1cm] {$\mathsf{v+2 \cdot w}$};
\end{scope}
\end{tikzpicture}
\end{document}