Initialisation du projet pst-solides3d.git (SVN revision 142)
[pst-solides3d.git] / doc-en / .svn / text-base / par-projectioncourbe-en.tex.svn-base
1 \section{Curves of real-valued and \Index{parameterised functions}}
2
3 \subsection{Curve of a real-valued function}
4
5 The object \Lkeyword{courbe} allows us to draw a curve, where the
6 name is given with the option \Lkeyword{function}. This \Index{function},
7 with values in $\mathbb{R}$, has to be defined by the macro
8 \verb+\defFunction+ (see the appropriate paragraph for more
9 details).
10
11 We can define this function either in algebraic notation, with the
12 option \Lkeyword{algebraic}, or in Reverse Polish Notation (RPN),
13 with variables like $(x,u,t\ldots)$, using an expression of the
14 following form:
15
16
17 \begin{verbatim}
18 \defFunction[algebraic]{nom_fonction}(x){x*sin(x)}{}{}
19 \end{verbatim}
20
21 \begin{verbatim}
22 \defFunction{nom_fonction}(x){x dup sin mul}{}{}
23 \end{verbatim}
24
25
26 \encadre{This expression needs to be included within a
27 \texttt{pspicture} environment.}
28
29 The limits of the variables are defined by the option
30 \texttt{\Lkeyword{range}=$xmin$ $xmax$}, and the option \texttt{argument=$n$}
31 defines the number of points to be plotted when drawing the \Index{curve}.
32
33 \begin{LTXexample}[width=7.5cm]
34 \begin{pspicture}(-3,-3)(4,3.5)%
35 \psframe*[linecolor=blue!50](-3,-3)(4,3.5)
36 \psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
37 \psset{solidmemory}
38 \defFunction[algebraic]{1_sin}(x){2*sin(1/x)}{}{}
39 \psSolid[object=grille,
40    base=-3 0 -3 3,
41    linewidth=0.5\pslinewidth,linecolor=gray,]
42 %% definition du plan de projection
43 \psSolid[object=plan,
44    definition=equation,
45    args={[1 0 0 0] 90},
46    base=-3.2 3.2 -2.2 2.2,
47    planmarks,
48    showBase,
49    name=monplan]
50 \psset{plan=monplan}
51 \psSolid[object=plan,
52    args=monplan,
53    linecolor=gray!40,
54    plangrid,
55    action=none]
56 \psProjection[object=courbe,
57    linecolor=red,
58    range=-3 3,resolution=720,
59    function=1_sin]
60 \composeSolid
61 \axesIIID(4,2,2)(5,4,3)
62 \end{pspicture}
63 \end{LTXexample}
64
65 \subsection{\Index{Parameterised curves}}
66
67 The technique used here is analogous to the above, with the
68 difference that the values now come from $\mathbb{R}^2$, and the
69 object for the macro \Lcs{psProjection} is now \Lkeyword{courbeR2}.
70
71 For example, to draw a circle of radius $3$ and centre $O$, we
72 type:
73
74 \begin{verbatim}
75 \defFunction[algebraic]{cercle}(t){3*cos(t)}{3*sin(t)}{}
76 \end{verbatim}
77
78
79 Another example: \Index{Lissajous} curves.
80
81
82 \begin{LTXexample}[width=7.5cm]
83 \begin{pspicture}(-3,-3)(4,3.5)%
84 \psframe*[linecolor=blue!50](-3,-3)(4,3.5)
85 \psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
86 \psset{solidmemory}
87 \defFunction[algebraic]{F}(t){2*sin(0.57735*t)}{2*sin(0.707*t)}{}
88 \psSolid[object=grille,
89    base=-3 0 -3 3,
90    linewidth=0.5\pslinewidth,linecolor=gray,]
91 %% definition du plan de projection
92 \psSolid[object=plan,
93    definition=equation,
94    args={[1 0 0 0] 90},
95    base=-3.2 3.2 -2.2 2.2,
96    name=monplan,
97    planmarks,
98    showBase]
99 \psset{plan=monplan}
100 \psSolid[object=plan,
101    args=monplan,
102    linecolor=gray!40,
103    plangrid,
104    action=none]
105 \psProjection[object=courbeR2,
106    range=-25.12 25.12,resolution=720,
107    normal=1 1 2,linecolor=red,
108    function=F]
109 \composeSolid
110 \axesIIID(4,2,2)(5,4,3)
111 \end{pspicture}
112 \end{LTXexample}
113
114 \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.