Import old talks from 2010 and 2011 (Boston).
[libguestfs-talks.git] / 2010 / example.tex
1 % Distance, velocity and acceleration vectors
2 % Author: Jason Waskiewicz
3 \documentclass{article}
4 \usepackage[utf8]{inputenc}
5 \usepackage{tikz}
6 %%%<
7 \usepackage{verbatim}
8 \usepackage[active,tightpage]{preview}
9 \PreviewEnvironment{tikzpicture}
10 \setlength\PreviewBorder{5pt}%
11 %%%>
12
13 \begin{comment}
14 :Title: Distance, velocity and acceleration vectors
15 :Slug: dva-vectors
16
17 \end{comment}
18
19 \begin{document}
20 \begin{tikzpicture}[scale=2,>=stealth]
21
22 %Draw Circle radius 1 cm
23     \draw (0,0) circle (1cm);
24     
25 %The foreach command counts the angle of the distance vectors and which distance vector
26     \foreach \angle/\count in {20/1,140/2,260/3}
27         {
28
29 %Draws the 3 distance vectors
30         \draw [name=distance vectors,very thick,->] (
31             0,0) -- node[near start,fill=white] {$\vec{r}_{\count}$} (\angle:1cm);
32         
33 %Draws the 3 velocity vectors at right angles to the distance vectors
34         \draw [name=velocity vectors,rotate around={90:(\angle:1cm)},very thick,->]
35             (\angle:1cm) -- node[fill=white] {$\vec{v}_{\count}$} (\angle:1.6cm) ;
36         
37 %Draws the 3 acceleration vectors directed inward and offset slightly from the distance vectors
38         \draw [name=acceleration vectors,very thick,->]
39             (\angle+5:1cm) -- node[fill=white] {$\vec{a}_{\count}$} (\angle+15:0.3cm) ;
40     }
41
42 \end{tikzpicture}
43 \end{document}