[Tex/LaTex] Labeling Drawing of Euclidean Vector

diagramsvector

I would like to know how I would go about labeling the Euclidean vectors in a diagram. For example, if I use the code provided below to draw a diagram which depicts three vectors, how would I label the appropriate vectors as, say, u, v, and uv?

I am disappointed by the lack of antialiasing and quality of rasterization of the lines when I view the generated postscript or PDF file using the GNU Document Viewer (for reference, I am using Ubuntu 10.10, 64-bit at the time of this writing). Would using an EPS file instead of providing the following inline commands result in a higher-quality output? If so, could you please recommend an application that can generate these kinds of vector diagrams?

\setlength{\unitlength}{1cm}
\begin{picture}(5,5)
\linethickness{1pt}
\put(0,0){\vector(3,2){3}}
\put(0,0){\vector(2,3){2}}
\put(2,3){\vector(1,-1){1}}
\end{picture}

Best Answer

My solution to this would be to use PGF/Tikz, which is way nicer with rasterization. You could achieve the same drawing like this :

\begin{tikzpicture}[auto]
    \node (a) at (0,0)  {};
    \node (b) at (2,3)  {};
    \node (c) at (3,2)  {};

    \draw[->] (a) to node {u} (b);
    \draw[->] (b) to node {u-v} (c);
    \draw[->] (a) to node {v} (c);
\end{tikzpicture}

Or something of the sort, you can consult the PGF/Tikz manual which is full of nice examples (for instance summing coordinates).

And no, an EPS file won't give a nicer result, since it has to be scaled at some point, and second it is not easy to change your diagram once you've included it with the EPS method.

Related Question