summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-solides3d/doc-en/par-projectioncourbe_en_corr.tex
blob: e506dda2d2aa4aab648a661c6dc881dcb6d1900f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
\section{Curves of real-valued and parameterised functions}

\subsection{Curve of a real-valued function}

The object \texttt{courbe} allows us to draw a curve, where the
name is given with the option \texttt{function}. This function,
with values in $\mathbb{R}$, has to be defined by the macro
\verb+\defFunction+ (see the appropriate paragraph for more
details).

We can define this function either in algebraic notation, with the
option \texttt{[algebraic]}, or in Reverse Polish Notation (RPN),
with variables like $(x,u,t\ldots)$, using an expression of the
following form:


\begin{verbatim}
\defFunction[algebraic]{nom_fonction}(x){x*sin(x)}{}{}
\end{verbatim}

\begin{verbatim}
\defFunction{nom_fonction}(x){x dup sin mul}{}{}
\end{verbatim}


\encadre{This expression needs to be included within a
\texttt{pspicture} environment.}

The limits of the variables are defined by the option
\texttt{range=$xmin$ $xmax$}, and the option \texttt{argument=$n$}
defines the number of points to be plotted when drawing the curve.

\begin{LTXexample}[width=7.5cm]
\begin{pspicture}(-3,-3)(4,3.5)%
\psframe*[linecolor=blue!50](-3,-3)(4,3.5)
\psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
\psset{solidmemory}
\defFunction[algebraic]{1_sin}(x){2*sin(1/x)}{}{}
\psSolid[object=grille,
   base=-3 0 -3 3,
   linewidth=0.5\pslinewidth,linecolor=gray,]
%% definition du plan de projection
\psSolid[object=plan,
   definition=equation,
   args={[1 0 0 0] 90},
   base=-3.2 3.2 -2.2 2.2,
   planmarks,
   showBase,
   name=monplan]
\psset{plan=monplan}
\psSolid[object=plan,
   args=monplan,
   linecolor=gray!40,
   plangrid,
   action=none]
\psProjection[object=courbe,
   linecolor=red,
   range=-3 3,resolution=720,
   function=1_sin]
\composeSolid
\axesIIID(4,2,2)(5,4,3)
\end{pspicture}
\end{LTXexample}

\subsection{Parameterised curves}

The technique used here is analogous to the above, with the
difference that the values now come from $\mathbb{R}^2$, and the
object for the macro \bs{psProjection} is now \texttt{courbeR2}.

For example, to draw a circle of radius $3$ and centre $O$, we
type:

\begin{verbatim}
\defFunction[algebraic]{cercle}(t){3*cos(t)}{3*sin(t)}{}
\end{verbatim}


Another example: Lissajous curves.


\begin{LTXexample}[width=7.5cm]
\begin{pspicture}(-3,-3)(4,3.5)%
\psframe*[linecolor=blue!50](-3,-3)(4,3.5)
\psset{lightsrc=50 20 20,viewpoint=50 30 15,Decran=60}
\psset{solidmemory}
\defFunction[algebraic]{F}(t){2*sin(0.57735*t)}{2*sin(0.707*t)}{}
\psSolid[object=grille,
   base=-3 0 -3 3,
   linewidth=0.5\pslinewidth,linecolor=gray,]
%% definition du plan de projection
\psSolid[object=plan,
   definition=equation,
   args={[1 0 0 0] 90},
   base=-3.2 3.2 -2.2 2.2,
   name=monplan,
   planmarks,
   showBase]
\psset{plan=monplan}
\psSolid[object=plan,
   args=monplan,
   linecolor=gray!40,
   plangrid,
   action=none]
\psProjection[object=courbeR2,
   range=-25.12 25.12,resolution=720,
   normal=1 1 2,linecolor=red,
   function=F]
\composeSolid
\axesIIID(4,2,2)(5,4,3)
\end{pspicture}
\end{LTXexample}

\endinput