1 \section {Courbes de fonction numériques et courbes paramétrées}
3 \subsection {Courbe de fonction numérique}
5 L'objet \Cadre{courbe} permet d'obtenir le tracé de la courbe d'une
6 fonction numérique dont le nom est passée \textsl{via\/} l'argument
7 \Cadre{function}. Cette fonction à valeurs dans \textbf{R} ayant été
8 préalablement définie avec la macro \verb+\defFunction+ vue plus avant
11 On pourra donc définir cette fonction, soit en notation algébrique
12 avec l'option \Cadre{[algebraic]}, soit en notation polonaise
13 inversée (langage postscript), avec une variable quelconque
14 $(x,u,t\ldots)$, par une expression de la forme suivant le cas~:
18 \defFunction[algebraic]{nom_fonction}(x){x*sin(x)}{}{}
24 \defFunction{nom_fonction}(x){x dup sin mul}{}{}
28 Cette expression dans doit être incluse dans l'environnement
31 Les limites de la variable sont définies dans l'option
32 \Cadre{range=$xmin$ $xmax$}, et l'option \Cadre{resolution=$n$} permet
33 de préciser le nombre de points calculés pour le dessin de la courbe.
37 \begin{pspicture}(-3,-3)(4,3.5)%
38 \psframe*[linecolor=blue!50](-3,-3)(4,3.5)
39 \psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
41 \defFunction[algebraic]{1_sin}(x){2*sin(1/x)}{}{}
42 \psSolid[object=grille,
44 linewidth=0.5\pslinewidth,linecolor=gray,]
45 %% definition du plan de projection
49 base=-3.2 3.2 -2.2 2.2,
61 \psProjection[object=courbe,
63 range=-3 3,resolution=720,
67 \axesIIID(4,2,2)(5,4,3)
74 \defFunction[algebraic]{1_sin}(x)
78 \psProjection[object=courbe,linecolor=red,
79 range=-3 3,resolution=720,function=1_sin]
87 \subsection {Courbes paramétrées}
89 La technique est analogue, à la différence près que la fonction
90 évoquée est à valeurs dans $R^2$, et que l'objet passé en paramètre à
91 \verb+\psProjection+ est \Cadre{courbeR2}.
93 Pour dessiner un cercle de rayon $3$, on écrira :
97 \defFunction[algebraic]{cercle}(t){3*cos(t)}{3*sin(t)}{}
101 Autre exemple : les courbes de Lissajous.
106 \begin{pspicture}(-3,-3)(4,3.5)%
107 \psframe*[linecolor=blue!50](-3,-3)(4,3.5)
108 \psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
110 \defFunction[algebraic]{F}(t){2*sin(0.57735*t)}{2*sin(0.707*t)}{}
111 \psSolid[object=grille,
113 linewidth=0.5\pslinewidth,linecolor=gray,]
114 %% definition du plan de projection
115 \psSolid[object=plan,
118 base=-3.2 3.2 -2.2 2.2,
124 \psSolid[object=plan,
130 \psProjection[object=courbeR2,
131 range=-25.12 25.12,resolution=720,
132 normal=1 1 2,linecolor=red,
136 \axesIIID(4,2,2)(5,4,3)
143 \defFunction[algebraic]{F}(t)
149 \psProjection[object=courbeR2,
150 range=-25.12 25.12,resolution=720,
151 normal=1 1 2,linecolor=red,