Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / .svn / text-base / par-vecteur-en.tex.svn-base
1 \section{The object \texttt{vecteur}}
2
3 \subsection{Definition with components}
4
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}.
7
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,
12     action=draw*,
13    args=0 0 1,
14    linecolor=yellow]%
15 \psSolid[object=vecteur,
16    args=1 0 0,
17    linecolor=red]
18 \psSolid[object=vecteur,
19    args=0 0 1,
20    linecolor=blue](1,0,0)
21 \end{pspicture*}
22 \end{LTXexample}
23
24 \subsection{Definition with 2 points}
25
26 We can also define a vector with 2 given points $A$ and $B$ of $\mathbb{R}^3$.
27
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$
30
31 If the points $A$ and $B$ were already defined, we can easily use the named variables:
32 \texttt{\Lkeyword{args}=$A$ $B$}.
33
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)
37 \psSolid[object=plan,
38    linecolor=gray,
39    definition=equation,
40    args={[0 1 1 0]},
41    base=-1 3 -2 2,
42    planmarks,
43    plangrid]
44 \psSolid[object=vecteur,
45    definition=vecteur3d,
46    args=0 0 1 1 1 1]%
47 \end{pspicture*}
48 \end{LTXexample}
49
50
51 \subsection{Some other definitions of a vector}
52
53 There are some other possibilities to define a \Index{vector}. Here a list of some
54 possible definitions with the appropriate arguments:
55
56 \begin{itemize}
57
58 \item \texttt{\Lkeyword{definition}=\Lkeyval{addv3d}};
59 \texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.
60
61 Addition of 2 vectors.
62
63 \item \texttt{\Lkeyword{definition}=\Lkeyval{subv3d}};
64 \texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.
65
66 Difference of 2 vectors.
67
68 \item \texttt{\Lkeyword{definition}=\Lkeyval{mulv3d}};
69 \texttt{\Lkeyword{args}= $\vec u$ $\lambda $}.
70
71 \Index{Multiplication} of a vector with a real.
72
73 \item \texttt{\Lkeyword{definition}=\Lkeyval{vectprod3d}};
74 \texttt{\Lkeyword{args}= $\vec u$ $\vec v$}.
75
76 \Index{Vector product} of 2 vectors.
77
78 \item \texttt{\Lkeyword{definition}=\Lkeyval{normalize3d}};
79 \texttt{\Lkeyword{args}= $\vec u$}.
80
81 \Index{Normalized vector} $\Vert \vec u\Vert ^{-1} \vec u$.
82
83 \end{itemize}
84
85 \endinput

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.