1 \section{The object
\texttt{vecteur
}}
3 \subsection{Definition with components
}
5 The object
\Lkeyword{vecteur
} allows us to define a
\Index{vector
}. The simplest way to do
6 that is to use the argument
\texttt{\Lkeyword{args
}=$x$ $y$ $z$
} to specify its
\Index{components
}.
8 \psset{lightsrc=
10 -
20 50,viewpoint=
50 -
20 30 rtp2xyz,Decran=
100}
9 \begin{LTXexample
}[width=
6cm
]
10 \begin{pspicture*
}(-
1,-
1)(
1,
2)
11 \psSolid[object=vecteur,
15 \psSolid[object=vecteur,
18 \psSolid[object=vecteur,
20 linecolor=blue
](
1,
0,
0)
24 \subsection{Definition with
2 points
}
26 We can also define a vector with
2 given points $A$ and $B$ of $
\mathbb{R
}^
3$.
28 We then use the arguments
\texttt{\Lkeyword{definition
}=
\Lkeyval{vecteur3d
}} and
\texttt{\Lkeyword{args
}=$x_A$ $y_A$ $z_A$ $x_B$
29 $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$
31 If the points $A$ and $B$ were already defined, we can easily use the named variables:
32 \texttt{\Lkeyword{args
}=$A$ $B$
}.
34 \psset{lightsrc=
10 -
20 50,viewpoint=
20 20 20,Decran=
20}
35 \begin{LTXexample
}[width=
6cm
]
36 \begin{pspicture*
}(-
3,-
3)(
4.5,
2)
44 \psSolid[object=vecteur,
51 \subsection{Some other definitions of a vector
}
53 There are some other possibilities to define a
\Index{vector
}. Here a list of some
54 possible definitions with the appropriate arguments:
58 \item \texttt{\Lkeyword{definition
}=
\Lkeyval{addv3d
}};
59 \texttt{\Lkeyword{args
}= $
\vec u$ $
\vec v$
}.
61 Addition of
2 vectors.
63 \item \texttt{\Lkeyword{definition
}=
\Lkeyval{subv3d
}};
64 \texttt{\Lkeyword{args
}= $
\vec u$ $
\vec v$
}.
66 Difference of
2 vectors.
68 \item \texttt{\Lkeyword{definition
}=
\Lkeyval{mulv3d
}};
69 \texttt{\Lkeyword{args
}= $
\vec u$ $
\lambda $
}.
71 \Index{Multiplication
} of a vector with a real.
73 \item \texttt{\Lkeyword{definition
}=
\Lkeyval{vectprod3d
}};
74 \texttt{\Lkeyword{args
}= $
\vec u$ $
\vec v$
}.
76 \Index{Vector product
} of
2 vectors.
78 \item \texttt{\Lkeyword{definition
}=
\Lkeyval{normalize3d
}};
79 \texttt{\Lkeyword{args
}= $
\vec u$
}.
81 \Index{Normalized vector
} $
\Vert \vec u
\Vert ^
{-
1} \vec u$.