Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

matheMakrosFunctions.tex 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. %%
  2. %% Graphiken mit tikz: BBW-Mathe-akros
  3. %%
  4. \tikzset{bbwgrid/.style={help lines,color=bbwMMFarbe!25,thick,step=0.5cm}}
  5. %% einfach die folgende Zeile neu definieren bei kleineren Graphen und
  6. %% scale auf z. B. 0.5 setzen
  7. \tikzset{graphSkalierung/.style={xscale=1,yscale=1}}
  8. %% Koordinatensystem ohne Zahlen
  9. \newcommand{\bbwGridPartLeer}[4]{
  10. % grid:
  11. \draw[bbwgrid,graphSkalierung] (#1,#3) grid (#2,#4);
  12. % axes
  13. \draw[thick,graphSkalierung] (#1,0) -- (#2,0);
  14. \draw[thick,graphSkalierung] (0,#3) -- (0,#4);
  15. \foreach \x in {#1, ..., -1} \draw[graphSkalierung] (\x cm, 3pt) -- (\x cm, -3pt);%% node[anchor=north]{$\x$};
  16. \foreach \x in {1, ..., #2} \draw[graphSkalierung] (\x cm, 3pt) -- (\x cm, -3pt);%% node[anchor=north]{$\x$};
  17. \foreach \y in {#3, ..., -1} \draw[graphSkalierung] (-3pt, \y cm) -- (3pt, \y cm);%% node[anchor=east]{$\y\,\,$};
  18. \foreach \y in {1, ..., #4} \draw[graphSkalierung] (-3pt, \y cm) -- (3pt, \y cm);%% node[anchor=east]{$\y\,\,$};
  19. \draw[->,thick,graphSkalierung] (#2,0) -- ({#2+0.5},0) node[anchor=west]{$x$};
  20. \draw[->,thick,graphSkalierung] (0,#4) -- (0,{#4+0.5}) node[anchor=south]{$y$};
  21. }
  22. \newcommand{\bbwGridPart}[4]{
  23. % grid:
  24. \draw[bbwgrid,graphSkalierung] (#1,#3) grid (#2,#4);
  25. % axes
  26. \draw[thick,graphSkalierung] (#1,0) -- (#2,0);
  27. \draw[thick,graphSkalierung] (0,#3) -- (0,#4);
  28. \foreach \x in {#1, ..., -1} \draw[graphSkalierung] (\x cm, 3pt) -- (\x cm, -3pt) node[anchor=north,graphSkalierung]{\small $\x\,\,\,$};
  29. \foreach \x in {1, ..., #2} \draw[graphSkalierung] (\x cm, 3pt) -- (\x cm, -3pt) node[anchor=north,graphSkalierung]{$\x$};
  30. \foreach \y in {#3, ..., -1} \draw[graphSkalierung] (-3pt, \y cm) -- (3pt, \y cm) node[anchor=east,graphSkalierung]{\small $\y\,\,$};
  31. \foreach \y in {1, ..., #4} \draw[graphSkalierung] (-3pt, \y cm) -- (3pt, \y cm) node[anchor=east,graphSkalierung]{$\y\,\,$};
  32. \draw[->,thick,graphSkalierung] (#2,0) -- ({#2+0.5},0) node[anchor=west]{$x$};
  33. \draw[->,thick,graphSkalierung] (0,#4) -- (0,{#4+0.5}) node[anchor=south]{$y$};
  34. }
  35. %% A function within a Grid (without painting the grid)
  36. %% #1: funciton eg 2*\x (x has to be backquoted)
  37. %% #2: Domain eg. -1:2.5
  38. %% #3: colour eg red
  39. \newcommand{\bbwFuncC}[3]{\draw[domain=#2,smooth,samples=200,variable=\x,#3] plot ({\x},{#1});
  40. }
  41. %% A function within a Grid (without painting the grid)
  42. \newcommand{\bbwFunc}[2]{\bbwFuncC{#1}{#2}{blue}}
  43. %% Declare a function-plot
  44. %% xmin,xmax,ymin,ymax,fct,domain(x-min, x-max)
  45. %% example: \bbwFunction{-4}{3}{-2}{5}{-\x*\x- \x + 4.5}{-3:2}
  46. \newcommand{\bbwFunction}[6]{\begin{tikzpicture}
  47. \bbwGridPart{#1}{#2}{#3}{#4}
  48. \bbwFunc{#5}{#6}
  49. %% \draw[domain=#6,smooth,samples=200,variable=\x,blue] plot ({\x},{#5});
  50. \end{tikzpicture}}
  51. %% a whole graph having a coordinate-system #1-#4 and any tizpicture content #5:
  52. \newcommand{\bbwGraph}[5]{\begin{tikzpicture}\bbwGridPart{#1}{#2}{#3}{#4}#5\end{tikzpicture}}
  53. \newcommand{\bbwGraphLeer}[5]{\begin{tikzpicture}\bbwGridPartLeer{#1}{#2}{#3}{#4}#5\end{tikzpicture}}
  54. %% Dots and lines:
  55. %% Dot example: \bbwDot{-1,2}{red}{east}{A}
  56. \newcommand{\bbwDot}[4]{\filldraw[color=#2!60, fill=#2!5, thick](#1) circle(0.05) node[anchor=#3]{$#4$};}
  57. %% Line example: \bbwLine{-1,0}{2,3}{red}
  58. \newcommand{\bbwLine}[3]{\draw[thick,color=#3] (#1)--(#2);}
  59. \newcommand{\bbwArrow}[3]{\draw[thick,color=#3,->] (#1)--(#2);}
  60. %% Strecke mit zwei Endpunkten
  61. %% #1, #2: Koordinaten der Endpunkte
  62. %% #3: Ort der Beschriftung
  63. %% #4: Beschtiftung (z. B. "a)")
  64. %% #5: farbe der Strecke und der Beschriftung
  65. \newcommand{\bbwStrecke}[5]{%%
  66. \bbwLine{#1}{#2}{#5}%
  67. \bbwDot{#1}{#5}{west}{}%
  68. \bbwDot{#2}{#5}{west}{}%
  69. \draw (#3) node{{\color{#5}#4}};
  70. }%%
  71. %% Draw a single letter or small text
  72. % #1: Position eg 4,4
  73. % #2: letter eg f or blah
  74. % #3: colour
  75. \newcommand{\bbwLetter}[3]{\draw[color=#3](#1) node{$#2$};}
  76. %%% ABC-Formel
  77. %% usage \abcd{<a>}{<b>}{<c>}
  78. %% example usage: \abcd{b}{5}{\sqrt{4}}
  79. \newcommand{\abcd}[3]{$\frac{-(#2)\pm\sqrt{(#2)^2 - 4\cdot{}(#1)\cdot{}(#3)}}{2\cdot{}(#1)}$}
  80. %% coordSysBBWFlex
  81. %% Flexibles Koordinatensystem mit Pfeilen und Pfeilbeschriftung, aber
  82. %% noch ohne "ticks".
  83. %% #1 : Rastergröße
  84. %% #2-#5: Größe des Rasters in cm
  85. %% #6 : Beschriftung in x-Richtung (in y-Richtung ist es immer y
  86. %% #7 : Zu zeichnende Funktion
  87. %% #8 : Ticks oder was sonst noch komplexeres in die Grafik muss
  88. \newcommand{\bbwFunctionColour}{blue}
  89. \newcommand{\coordSysBBWFlex}[8]{
  90. \begin{tikzpicture}
  91. \draw[step = #1, thin, cyan!20] (#2, #4) grid (#3, #5);
  92. \draw[thick, ->] (#2,0) -- (#3,0) node[anchor = west] {$#6$};
  93. \draw[thick, ->] (0,#4) -- (0,#5) node[anchor = south] {$y$};
  94. \draw[domain=#2:#3,smooth,samples=200,variable=\x,\bbwFunctionColour] plot ({\x},{#7});
  95. #8;
  96. \end{tikzpicture}
  97. \renewcommand{\bbwFunctionColour}{blue}
  98. }%% end coordSysBBW
  99. \newcommand{\einheitskreis}{
  100. \definecolor{qqwuqq}{rgb}{0,0.79,0}
  101. \definecolor{qqqqff}{rgb}{0,0,1}
  102. \definecolor{qqzzzz}{rgb}{0,0.6,0.6}
  103. \definecolor{ffwwqq}{rgb}{1,0.4,0}
  104. \definecolor{qqccww}{rgb}{0,0.8,0.4}
  105. \definecolor{uququq}{rgb}{0.25,0.25,0.25}
  106. \definecolor{xdxdff}{rgb}{0.49,0.49,1}
  107. \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=2.5cm,y=2.5cm]
  108. \draw[->,color=black] (-1.5,0) -- (1.5,0);
  109. \foreach \x in {-1.5,-1,-0.5,0.5,1}
  110. \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
  111. \draw[->,color=black] (0,-1.5) -- (0,1.5);
  112. \foreach \y in {-1.5,-1,-0.5,0.5,1}
  113. \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
  114. \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
  115. \clip(-1.5,-1.5) rectangle (1.5,1.5);
  116. \draw [shift={(0,0)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (0:0.28) arc (0:46.14:0.28) -- cycle;
  117. \draw(0,0) circle (2.5cm);
  118. \draw [domain=-1.5:1.5] plot(\x,{(-0-0.72*\x)/-0.69});
  119. \draw (0.69,-1.5) -- (0.69,1.5);
  120. \draw (1,-1.5) -- (1,1.5);
  121. \draw (1.12,0.6) node[anchor=north west,color=qqccww] {t};
  122. \draw (0.50,0.42) node[anchor=north west,color=ffwwqq] {s};
  123. \draw (0.30,0.21) node[anchor=north west,color=qqzzzz] {c};
  124. \draw [line width=1.2pt,color=qqccww] (1,1.04)-- (1,0);
  125. \draw [line width=1.2pt,color=ffwwqq] (0.69,0.72)-- (0.69,0);
  126. \draw [line width=1.6pt,color=qqzzzz] (0.69,0)-- (0,0);
  127. \begin{scriptsize}
  128. \fill [color=xdxdff] (0.69,0.72) circle (1.5pt);
  129. \draw[color=xdxdff] (0.49,0.71) node {$P$};
  130. \fill [color=uququq] (0.69,0) circle (1.5pt);
  131. \draw[color=uququq] (0.8,0.12) node {$Xp$};
  132. %%\fill [color=uququq] (1,1.04) circle (1.5pt);
  133. %%\draw[color=uququq] (1.22,0.95) node {$Yp$};
  134. \fill [color=uququq] (0.69,0.72) circle (1.5pt);
  135. \draw[color=uququq] (0.82,0.7) node {$Yp$};
  136. \fill [color=qqqqff] (0,0) circle (1.5pt);
  137. \draw(0.20,0.09) node {$\varphi$};
  138. \end{scriptsize}
  139. \end{tikzpicture}\par
  140. }%% END Command \einheitskreis
  141. \newcommand{\einheitskreisT}{%% Tangens
  142. \definecolor{qqwuqq}{rgb}{0,0.79,0}
  143. \definecolor{qqqqff}{rgb}{0,0,1}
  144. \definecolor{qqzzzz}{rgb}{0,0.6,0.6}
  145. \definecolor{ffwwqq}{rgb}{1,0.4,0}
  146. \definecolor{qqccww}{rgb}{0,0.8,0.4}
  147. \definecolor{uququq}{rgb}{0.25,0.25,0.25}
  148. \definecolor{xdxdff}{rgb}{0.49,0.49,1}
  149. \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=2.5cm,y=2.5cm]
  150. \draw[->,color=black] (-1.5,0) -- (1.5,0);
  151. \foreach \x in {-1.5,-1,-0.5,0.5,1}
  152. \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
  153. \draw[->,color=black] (0,-1.5) -- (0,1.5);
  154. \foreach \y in {-1.5,-1,-0.5,0.5,1}
  155. \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
  156. \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
  157. \clip(-1.5,-1.5) rectangle (1.5,1.5);
  158. \draw [shift={(0,0)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (0:0.28) arc (0:46.14:0.28) -- cycle;
  159. \draw(0,0) circle (2.5cm);
  160. \draw [domain=-1.5:1.5] plot(\x,{(-0-0.72*\x)/-0.69});
  161. \draw (0.69,-1.5) -- (0.69,1.5);
  162. \draw (1,-1.5) -- (1,1.5);
  163. \draw (1.12,0.6) node[anchor=north west,color=qqccww] {t};
  164. \draw (0.50,0.42) node[anchor=north west,color=ffwwqq] {s};
  165. \draw (0.30,0.21) node[anchor=north west,color=qqzzzz] {c};
  166. \draw [line width=1.2pt,color=qqccww] (1,1.04)-- (1,0);
  167. \draw [line width=1.2pt,color=ffwwqq] (0.69,0.72)-- (0.69,0);
  168. \draw [line width=1.6pt,color=qqzzzz] (0.69,0)-- (0,0);
  169. \begin{scriptsize}
  170. \fill [color=xdxdff] (0.69,0.72) circle (1.5pt);
  171. \draw[color=xdxdff] (0.49,0.71) node {$P$};
  172. \fill [color=uququq] (0.69,0) circle (1.5pt);
  173. \draw[color=uququq] (0.8,0.12) node {$Xp$};
  174. %%\fill [color=uququq] (1,1.04) circle (1.5pt);
  175. %%\draw[color=uququq] (1.22,0.95) node {$Yp$};
  176. \fill [color=uququq] (0.69,0.72) circle (1.5pt);
  177. \draw[color=uququq] (0.82,0.7) node {$Yp$};
  178. \fill [color=qqqqff] (0,0) circle (1.5pt);
  179. %% Tangens
  180. \draw[color=uququq] (1.27,1) node {$T=(1|t)$};
  181. \fill [color=qqqqff] (1,1.05) circle (1.5pt);
  182. \draw(0.20,0.09) node {$\varphi$};
  183. \end{scriptsize}
  184. \end{tikzpicture}\par
  185. }%% END Command \einheitskreisT
  186. \newcommand{\miniEinheitskreis}{
  187. \tikzset{graphSkalierung/.style={xscale=2,yscale=2}}
  188. \bbwGraph{-1.5}{1.5}{-1.5}{1.5}{
  189. \bbwFuncC{ sqrt(4-\x*\x)}{-2:2}{lightgray}
  190. \bbwFuncC{-sqrt(4-\x*\x)}{-2:2}{lightgray}
  191. }
  192. \tikzset{graphSkalierung/.style={xscale=1,yscale=1}}
  193. }%% end newcommand miniEinheitskreis