summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-fct/doc/latex/TKZdoc-fct-asymptote.tex
blob: fdcf8a686efeb21235ba42e27555eee235847e47 (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
%!TEX root = /Users/ego/Boulot/TKZ/tkz-fct/doc-fr/TKZdoc-fct-main.tex
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
\section{Droites particulières}
%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––>
\subsection{ Tracer une ligne verticale }
\begin{NewMacroBox}{tkzVLine}{\oarg{local options}\marg{decimal number}}
Attention, la syntaxe est celle de \tkzname{fp} car on n'utilise pas \tkzname{gnuplot} pour tracer une droite.

\begin{tabular}{lll}
  \toprule
arguments &  exemple  & définition  \\ 
\midrule
\TAline{decimal number}{\tkzcname{tkzVLine\{1\}}}{Trace la droite $x=1$}
\bottomrule
\end{tabular} 

\medskip
\begin{tabular}{lll}  
\toprule
options  & défaut & définition             \\   
\midrule
\TOline{color     }{|black| }{  couleur du trait}
\TOline{line width}{|0.6pt| }{  épaisseur du point}
\TOline{style     }{|solid|}{  style du trait }
\bottomrule
\end{tabular}

\emph{voir les options les lignes dans \TIKZ} 
\end{NewMacroBox}


\subsection{Ligne verticale }
problème avec cette macro, en principe 1./3 devrait être acceptée.
\begin{tkzexample}[latex=8cm] 
\begin{tikzpicture}[scale=2]
   \tkzInit[xmax=3,ymax=2]
   \tkzAxeXY
   \tkzVLine[color      = blue,
             style      = dashed,
             line width = 1pt]{2}
      \tkzVLine[color      = red,
             style      = dashed,
             line width = 1pt]{1./3}  
\end{tikzpicture}
\end{tkzexample}   


\newpage   
\begin{NewMacroBox}{tkzVLines}{\oarg{local options}\marg{list of values}}
Attention, la syntaxe est celle de \tkzname{fp} car on n'utilise pas \tkzname{gnuplot} pour tracer une droite.

\begin{tabular}{lll}
  \toprule
arguments &  exemple  & définition  \\ 
\midrule
\TAline{list of values}{\tkzcname{tkzVLines\{1,4\}}}{Trace les droites $x=1$ et $x=4$}
\bottomrule
\end{tabular} 

\end{NewMacroBox}  

\subsection{Lignes verticales}  

\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}
 \tkzInit[xmax=5,ymax=5]
 \tkzAxeXY
 \tkzVLines[color = green]{1,2,...,4}
\end{tikzpicture}
\end{tkzexample}

\subsection{Ligne verticale et valeur calculée par \tkzname{fp} }
\begin{tkzexample}[]
\begin{tikzpicture}
  \tkzInit[xmin=-7,xmax=7,ymin=-1,ymax=1]
  \tkzAxeY
  \tkzAxeX[trig=2] 
  \foreach\v in {-2,-1,1,2}
  {\tkzVLine[color=red]{\v*\FPpi}} 
\end{tikzpicture} 
\end{tkzexample} 
 
\newpage
\subsection{Une ligne horizontale} 
\begin{NewMacroBox}{tkzHLine}{\oarg{local options}\marg{decimal number}}
\begin{tabular}{lll}
arguments &  exemple  & définition  \\ 
\midrule
\TAline{decimal number}{\tkzcname{tkzVLine\{1\}}}{Trace la droite $y=1$}
\end{tabular}
\end{NewMacroBox}
 
\begin{tkzexample}[latex=7cm]
\begin{tikzpicture}
  \tkzInit[xmax=80,xstep=20,ymax=2]
  \tkzAxeXY    
  \tkzHLine[color=red]{exp(1)-1}
\end{tikzpicture}
\end{tkzexample}     
\subsection{Asymptote horizontale}
Attention, une autre méthode consiste à écrire \tkzcname{tkzFct{$\text{k}$}} mais si \tkzname{ystep= $n$} avec $n$ entier naturel alors il est nécessaire d'écrire $k$ comme un nombre réel, par exemple si \tkzname{ystep= $3$} alors il faut écrire $k=5.0$.

\begin{tkzexample}[]
\begin{tikzpicture}[scale=2.5]
  \tkzInit[xmax=5,ymin=0.5,ymax=1.5,ystep=0.5]
  \tkzGrid
  \tkzAxeXY  
  \tkzFct[domain = 0:10]{x*exp(-x)+1}
  \tkzHLine[color=red,style=solid,line width=1.2pt]{1}
  \tkzDrawTangentLine[draw,color=blue](1)
  \tkzText[draw,fill = brown!20](2,0.75){$f(x)=x \text{e}^{-x}+1$}
 \end{tikzpicture}
 \end{tkzexample}



\newpage 

\subsection{Lignes horizontales}    
  
\begin{NewMacroBox}{tkzHLines}{\oarg{local options}\marg{list of values}}
\begin{tabular}{lll}
arguments &  exemple  & définition  \\ 
\midrule
\TAline{list of values}{\tkzcname{tkzHLines\{1,4\}}}{Trace les droites $y=1$ et $y=4$}
\bottomrule
\end{tabular}
\end{NewMacroBox} 

\begin{tkzexample}[]
\begin{tikzpicture}
 \tkzInit
 \tkzAxeXY
 \tkzHLines[color = green]{1,2,...,10}
\end{tikzpicture}
\end{tkzexample}


\newpage
\subsection{Asymptote horizontale et verticale}  
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1.25]
 \tkzInit
 \tkzGrid
 \tkzAxeXY
 \tkzFct[color=red,domain=1.001:1.9]{1+1/(log(x-1)**2)}
 \tkzFct[color=red,domain = 2.1:10]{1+1/(log(x-1)**2)}
 \tkzHLine[line width=1pt,color=red]{1}
 \tkzVLine[line width=1pt,color=blue]{2}
 \tkzDefPoint(1,1){A}
 \tkzDrawPoint[fill=white,color=Maroon,size=4](A) 
 \tkzDefPointByFct[draw,with=b]({1+exp(1)})
 \tkzLabelPoint[above right](tkzPointResult){$(1+\text{e}~;~2)$}
 \tkzText[draw,color = black,fill = brown!20](6,6)%
          {$f(x)=\dfrac{1}{\ln^2 (x-1)}+1$}  
\end{tikzpicture}  
\end{tkzexample}   

   
\endinput