# Labeling Drawing of Euclidean Vector

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 u - v?

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}

-

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.

-
Just tried out TikZ, and it works beautifully -- thanks! – void-pointer May 6 '11 at 1:05
I understand that this question was posted 4 1/2 years ago but I am just now learning Tikz. I repeated the above drawing of the vector diagram exactly (actually cut and paste copy) and the code works but with one slight foible. The edges do not meet exactly at a point at each corner. It is almost as if there were a tiny circular barrier around each corner that the edge line cannot penetrate. Maybe platform dependent? Using Macbook Pro with latest of all software (downloaded Mactex package about a week ago). – K7PEH Nov 8 '15 at 18:50
@K7PEH It's because a node is not a point, it would be better to use \coordinate (a) at (0,0); for this, and similar for b and c. This does the same as \node[coordinate](a) at (0,0) {};. – Torbjørn T. Nov 14 '15 at 16:20
@TorbjørnT. Thanks. – K7PEH Nov 14 '15 at 17:29
\documentclass{article}

\begin{document}
\begin{pspicture}(5,5)
\psStartPoint[A](0,0)% name prefix A for the vectors
\psVector(3,2)\psVector(1,-1)
\psline[linecolor=red,arrowscale=2]{->}(A0)(A2)
\end{pspicture}


-
Ah, this also looks very pleasing, and the code is compact and easily manageable. Thanks! – void-pointer May 5 '11 at 23:20

If you were almost satisfied with picture environment, probably you could just add

\usepackage{pict2e}


to the preamble. It turns latex picture into real vector pictures from pseudo-graphics and removes some strange limitations. For instance, you may plot circles of any radius and lines with any slope. Read package manual for the details.

-