\section{The object \texttt{vecteur}}

\subsection{Definition with components}

The object \Lkeyword{vecteur} allows us to define a \Index{vector}. The simplest way to do
that is to use the argument \texttt{\Lkeyword{args}=$x$ $y$ $z$} to specify its \Index{components}.

\psset{lightsrc=10 -20 50,viewpoint=50 -20 30 rtp2xyz,Decran=100}
\begin{LTXexample}[width=6cm]
\begin{pspicture*}(-1,-1)(1,2)
\psSolid[object=vecteur,
    action=draw*,
   args=0 0 1,
   linecolor=yellow]%
\psSolid[object=vecteur,
   args=1 0 0,
   linecolor=red]
\psSolid[object=vecteur,
   args=0 0 1,
   linecolor=blue](1,0,0)
\end{pspicture*}
\end{LTXexample}

\subsection{Definition with 2 points}

We can also define a vector with 2 given points $A$ and $B$ of $\mathbb{R}^3$.

We then use the arguments \texttt{\Lkeyword{definition}=\Lkeyval{vecteur3d}} and \texttt{\Lkeyword{args}=$x_A$ $y_A$ $z_A$ $x_B$
$y_B$ $z_B$} where  $(x_A, y_A, z_A)$ and $(x_B, y_B, z_B)$  are the appropriate coordinates of the points $A$ and $B$

If the points $A$ and $B$ were already defined, we can easily use the named variables:
\texttt{\Lkeyword{args}=$A$ $B$}.

\psset{lightsrc=10 -20 50,viewpoint=20 20 20,Decran=20}
\begin{LTXexample}[width=6cm]
\begin{pspicture*}(-3,-3)(4.5,2)
\psSolid[object=plan,
   linecolor=gray,
   definition=equation,
   args={[0 1 1 0]},
   base=-1 3 -2 2,
   planmarks,
   plangrid]
\psSolid[object=vecteur,
   definition=vecteur3d,
   args=0 0 1 1 1 1]%
\end{pspicture*}
\end{LTXexample}


\subsection{Some other definitions of a vector}

There are some other possibilities to define a \Index{vector}. Here a list of some
possible definitions with the appropriate arguments:

\begin{itemize}

\item \texttt{\Lkeyword{definition}=\Lkeyval{addv3d}};
\texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.

Addition of 2 vectors.

\item \texttt{\Lkeyword{definition}=\Lkeyval{subv3d}};
\texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.

Difference of 2 vectors.

\item \texttt{\Lkeyword{definition}=\Lkeyval{mulv3d}};
\texttt{\Lkeyword{args}= $\vec u$ $\lambda $}.

\Index{Multiplication} of a vector with a real.

\item \texttt{\Lkeyword{definition}=\Lkeyval{vectprod3d}};
\texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.

\Index{Vector product} of 2 vectors.

\item \texttt{\Lkeyword{definition}=\Lkeyval{normalize3d}};
\texttt{\Lkeyword{args}= $\vec u$}.

\Index{Normalized vector} $\Vert \vec u\Vert ^{-1} \vec u$.

\end{itemize}

\endinput
