summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-fct/doc/latex/TKZdoc-fct-param.tex
blob: a99cf863657850f2787a4c72d6a1e0a486dabbf8 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
%!TEX root = /Users/ego/Boulot/TKZ/tkz-fct/doc-fr/TKZdoc-fct-main.tex  
\section{Courbes avec équations paramétrées}
 \hypertarget{tfpa}{} 
\begin{NewMacroBox}{tkzFctPar}{\oarg{local options}\marg{$x(t)$}\marg{$y(t)$}}                                                 
  \emph{$x(t)$ et $y(t)$ sont des expressions utilisant la syntaxe de \tkzname{gnuplot}. La variable est $t$.} 

\medskip
\begin{tabular}{lll}
 \toprule
 options             & exemple & explication                         \\ 
 \midrule
\TAline{$x(t)$,$y(t)$}{\tkzcname{tkzFctPar[0:1]}\{\tkzcname{t**3}\}\{\tkzcname{t**2}\}}{$x(t)=t^3$,$y(t)=t^2$ }  
 \bottomrule
\end{tabular}  

Les options sont celles de \TIKZ.

\begin{tabular}{lll}
\toprule
options             & défaut & définition                         \\ 
\midrule
\TOline{domain}{-5:5}{domaine de la fonction}  
\TOline{samples}{200}{nombre de points utilisés}
\TOline{id} {tkzfonct}{permet d'identifier les noms des fichiers auxiliaires}
\TOline{color}{black}{couleur de la ligne}
\TOline{line width} {0.4pt}{épaisseur de la ligne}
\TOline{style} {solid}{style de la ligne}
\bottomrule
\end{tabular}
 \end{NewMacroBox}

\subsection{Courbe paramétrée exemple 1}

\begin{align*} 
x(t) &=t- \sin(t)\\
y(t) &=1-\cos(t)\\ 
\end{align*} 

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}
  \tkzInit[ymax=2.25,ystep=.5]  \tkzGrid
  \tkzAxeXY   
  \tkzFctPar[samples=400,domain=0:2*pi]{(t-sin(t))}{(1-cos(t))}
\end{tikzpicture} 
\end{tkzexample}
\end{center}


\newpage
\subsection{Courbe paramétrée exemple 2}

\begin{align*} 
x(t) &=t\times \sin(t)\\
y(t) &=t\times \cos(t)\\ 
\end{align*}  

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.25]
  \tkzInit[xmin=-50,xmax=50,xstep=10,
           ymin=-50,ymax=50,ystep=10]
  \tkzGrid
  \tkzAxeXY   
  \tkzFctPar[smooth,samples=200,domain=0:50]{t*sin(t)}{t*cos(t)} 
\end{tikzpicture}
\end{tkzexample}
\end{center}


\newpage
\subsection{Courbe paramétrée exemple 3}
\begin{align*} 
x(t) &=\exp(t)\times \sin(t)\\
y(t) &=\exp(t)\times \cos(t)\\ 
\end{align*}  
  
\begin{center}
\begin{tkzexample}[vbox]  
\begin{tikzpicture}[scale=1.5]
  \tkzInit[xmin=-2,xmax=10,xstep=2,ymin=-10,ymax=4,ystep=2]
  \tkzGrid[sub]
  \tkzAxeX[step=2] 
  \tkzAxeY[step=2]  
  \tkzFctPar[samples=400,domain=-pi:pi]{exp(t)*sin(t)}{exp(t)*cos(t)}
\end{tikzpicture}
\end{tkzexample} 
\end{center}


\newpage

\subsection{Courbe paramétrée exemple 4}  
\begin{align*} 
x(t) &=\cos^3(t)\\
y(t) &=\sin^3(t)\\ 
\end{align*}

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.25]
  \tkzInit[xmin=-1,xmax=1,xstep=.2,
           ymin=-1,ymax=1,ystep=.2]
  \tkzFctPar[color=red,
      line width=2pt,
      fill=orange,
      opacity=.4,
      samples=400,
      domain=0:2*pi]{(cos(t))**3}{(sin(t))**3}
\end{tikzpicture}
\end{tkzexample} 
\end{center}
 

\newpage
\subsection{Courbe paramétrée exemple 5}
Saint Valentin version 1
\begin{align*} 
x(t) &=\sin^3(t)\\
y(t) &=\cos(t)-\cos^4(t)\\ 
\end{align*}

 
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=4]
  \tkzInit[xmin=-1,xmax=1,ymin=-2,ymax=1]
  \tkzClip 
  \tkzFctPar[samples=500,smooth,domain=-pi:pi,
             ball color=red,shading=ball]%
            {(sin(t))**3}{cos(t)-(cos(t))**4}
\end{tikzpicture}  
\end{tkzexample} 
\end{center}


\newpage
\subsection{Courbe paramétrée exemple 6}
Saint Valentin version 2 from  \url{http://mathworld.wolfram.com/HeartCurve.html}

\begin{align*} 
x(t) &=\sin(t)\cos(t)\log(|t|)\\
y(t) &=\sqrt{(|t|)\cos(t)}\\ 
\end{align*}  

 
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.5]
   \tkzInit[xmin=-.4,xmax=.4,xstep=.1,ymin=0,ymax=.7,ystep=.1]
   \tkzClip
   \tkzFctPar[samples=2000,smooth,domain=-1:1,
             ball color=red,shading=ball]%
   {sin(t)*cos(t)*log(abs(t))}{sqrt(abs(t))*cos(t)}
\end{tikzpicture}
\end{tkzexample}
\end{center}
 
 
 \newpage
\subsection{Courbe paramétrée exemple 7}
Saint Valentin version 3 from  \url{http://en.wikipedia.org/wiki/Heart_(symbol)}

\begin{align*} 
x(t) &=16\sin^3(t)\\
y(t) &=13\cos(t)-5\cos(2t)-2cos(3t)-cos(4t)\\ 
\end{align*}  

 
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.75]
  \tkzInit[xmin=-20,xmax=20,xstep=5,ymin=-25,ymax=15,ystep=5]  
  \tkzClip
  \tkzFctPar[samples=400,smooth,domain=0:6.28,
             ball color=red,shading=ball]%
   {16*(sin(t))**3}{13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)}
\end{tikzpicture} 
\end{tkzexample}           
\endinput