Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / .svn / text-base / par-transformpointconnu-en.tex.svn-base
1 \section{\Index{Transformations} to a point}
2
3 Given is an initial point $A(x,y,z)$. Now we make some
4 rotations around the axes $Ox$, $Oy$ and $Oz$ with the appropriate angles (in degrees):
5 \verb+[RotX=valueX,RotY=valueY,RotZ=valueZ]+, in this order,
6 then translate it with the vector $(v_x,v_y,v_z)$. The problem is to get back
7 the coordinates of the image (final point) $A'(x',y',z')$.
8
9 The code
10 \texttt{\textbackslash psTransformPoint[RotX=valueX,RotY=valueY,
11  RotZ=valueZ](x y z)(vx,vy,vz)\{A'\}}\\
12 now allows us to save the node $A'$, the coordinates of the transformed point.
13
14 In the following example, $A(2,2,2)$ is one of the vertices of the initial
15 cube, where the centre is placed at the origin.
16
17 \begin{verbatim}
18 \psSolid[object=cube,a=4,action=draw*,linecolor=red]%
19 \end{verbatim}
20
21 Some transformations are applied to the cube:
22
23 \begin{verbatim}
24 \psSolid[object=cube,a=4,action=draw*,RotX=-30,RotY=60,RotZ=-60](7.5,11.25,10)%
25 \end{verbatim}
26
27 To obtain the image of $A$, we use the following command:
28
29
30 \begin{verbatim}
31 \psTransformPoint[RotX=-30,RotY=60,RotZ=-60](2 2 2)(7.5,11.25,10){A'}
32 \end{verbatim}
33
34 This allows us, for example, to name these points and then draw the vector $\overrightarrow{AA'}$.
35 \begin{center}
36 \begin{pspicture}(-2,-4)(6,6)
37 \psframe(-3,-4)(9,6)
38 \psset{viewpoint=50 20 30 rtp2xyz,Decran=50,unit=0.5}
39 \psSolid[object=cube,a=4,action=draw*,linecolor=red]%
40 \psPoint(2,2,2){A}\psdot(A)
41 \psSolid[object=cube,a=4,action=draw*,RotX=-30,RotY=60,RotZ=-60](7.5,11.25,10)%
42 \psTransformPoint[RotX=-30,RotY=60,RotZ=-60](2 2 2)(7.5,11.25,10){A'}
43 \psdot(A')\psline[linecolor=blue,arrowsize=0.3]{{o-v}}(A)(A')
44 \uput[u](A'){$A'$}\uput[u](A){$A$}
45 \psset{solidmemory,action=none}
46 \psSolid[object=cube,a=4,name=A1,](0,0,0)
47 \psSolid[object=plan,definition=solidface,args=A1 0,name=P0]
48 \psSolid[object=plan,definition=solidface,args=A1 1,name=P1]
49 \psSolid[object=plan,definition=solidface,args=A1 4,name=P4]
50 \psset{fontsize=100}
51 \psProjection[object=texte,linecolor=red,text=A,plan=P0]
52 \psProjection[object=texte,linecolor=red,text=B,plan=P1]
53 \psProjection[object=texte,linecolor=red,text=E,plan=P4]
54 \psSolid[object=cube,a=4,RotX=-30,RotY=60,RotZ=-60,name=A2,](7.5,11.25,10)
55 \psSolid[object=plan,definition=solidface,args=A2 0,name=P'0]
56 \psSolid[object=plan,definition=solidface,args=A2 1,name=P'1]
57 \psSolid[object=plan,definition=solidface,args=A2 2,name=P'2]
58 \psProjection[object=texte,text=A,plan=P'0]
59 \psProjection[object=texte,text=B,plan=P'1]
60 \psProjection[object=texte,text=C,plan=P'2]
61 \axesIIID(2,2,2)(10,10,8)
62 \end{pspicture}
63 \end{center}
64
65
66 \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.