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
|
%
% minmax.tex -- minimum und maximum
%
% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
%
\documentclass[tikz]{standalone}
\usepackage{amsmath}
\usepackage{times}
\usepackage{txfonts}
\usepackage{pgfplots}
\usepackage{csvsimple}
\usetikzlibrary{arrows,intersections,math}
\begin{document}
\def\skala{1}
\begin{tikzpicture}[>=latex,thick,scale=\skala]
\definecolor{darkgreen}{rgb}{0,0.5,0}
\def\mittellinie{
plot[domain=0:6.2832,samples=400]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159))})
}
\begin{scope}
\fill[color=darkgreen!20]
plot[domain=0:6.2832,samples=360]
({\x},{sin(180*\x/3.1415)})
--
plot[domain=6.2832:0,samples=360]
({\x},{cos(180*\x/3.1415)})
-- cycle;
\foreach \x in {0.5,1,...,6}{
\draw[color=darkgreen]
({\x},{sin(180*\x/3.1415)})
--
({\x},{cos(180*\x/3.1415)});
}
\node[color=darkgreen] at (2,-0.8) [left] {$|f(x)-g(x)|$};
\draw[color=darkgreen,line width=0.3pt] (2,-0.8) -- (2.5,-0.7);
\draw[color=blue,line width=1.4pt] plot[domain=0:6.29,samples=360]
({\x},{sin(180*\x/3.1415)});
\draw[color=red,line width=1.4pt] plot[domain=0:6.29,samples=360]
({\x},{cos(180*\x/3.1415)});
\draw[color=purple!50,line width=1.4pt] \mittellinie;
\node[color=purple!50] at (6.2832,0.5) [right] {$\frac12(f(x)+g(x))$};
\draw[->] (-0.1,0) -- (6.5,0) coordinate[label={below:$x$}];
\draw[->] (0,-1.1) -- (0,1.3) coordinate[label={right:$y$}];
\xdef\x{2}
\node[color=blue] at (\x,{sin(180*\x/3.1415)}) [above right] {$f(x)$};
\pgfmathparse{2.5*3.14159-\x}
\xdef\x{\pgfmathresult}
\node[color=red] at (\x,{cos(180*\x/3.1415)}) [above left] {$g(x)$};
\end{scope}
\draw[->,line width=4pt,color=gray!40] ({3.1415-1},-1.3) -- ({3.1415-2.3},-3);
\draw[->,line width=4pt,color=gray!40] ({3.1415+1},-1.3) -- ({3.1415+2.3},-3);
\node at ({3.1415-1.75},-2.15) [left] {$\frac12(f(x)+g(x))+\frac12|f(x)-g(x)|$};
\node at ({3.1415+1.75},-2.15) [right] {$\frac12(f(x)+g(x))-\frac12|f(x)-g(x)|$};
\def\s{(-0.1)}
\begin{scope}[xshift=-3.4cm,yshift=-4.6cm]
\fill[color=darkgreen!20]
\mittellinie
--
plot[domain=6.2832:0,samples=400]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)+abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))})
-- cycle;
\foreach \x in {0.5,1,...,6}{
\draw[color=darkgreen]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)+abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))})
--
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159))});
}
\draw[color=darkgreen,line width=1.4pt]
plot[domain=6.2832:0,samples=400]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)+abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))});
\node[color=darkgreen] at (2,-0.3) [left] {$|f(x)-g(x)|$};
\draw[color=darkgreen,line width=0.3pt] (2,-0.3) -- (2.5,0.2);
\draw[color=purple!50,line width=1.4pt] \mittellinie;
\pgfmathparse{0.75*3.1415+\s}
\xdef\x{\pgfmathresult}
\node[color=darkgreen] at (\x,{sin(180*\x/3.1415)}) [above right]
{$\max(f(x),g(x))$};
\node[color=purple!50] at ({1.25*3.1415},-0.7) [below]
{$\frac12(f(x)+g(x))$};
\draw[->] (-0.1,0) -- (6.5,0) coordinate[label={$x$}];
\draw[->] (0,-1.1) -- (0,1.3) coordinate[label={right:$y$}];
\end{scope}
\begin{scope}[xshift=+3.4cm,yshift=-4.6cm]
\fill[color=darkgreen!20]
\mittellinie
--
plot[domain=6.2832:0,samples=400]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)-abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))})
-- cycle;
\foreach \x in {0.5,1,...,6}{
\draw[color=darkgreen]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)-abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))})
--
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159))});
}
\draw[color=darkgreen,line width=1.4pt]
plot[domain=6.2832:0,samples=400]
({\x},{0.5*(sin(180*\x/3.14159)+cos(180*\x/3.14159)-abs(sin(180*\x/3.14159)-cos(180*\x/3.14159)))});
\node[color=darkgreen] at (3,0.3) [right] {$|f(x)-g(x)|$};
\draw[color=darkgreen,line width=0.3pt] (3,0.3) -- (2.5,-0.4);
\draw[color=purple!50,line width=1.4pt] \mittellinie;
\pgfmathparse{0.75*3.1415-\s}
\xdef\x{\pgfmathresult}
\node[color=darkgreen] at (\x,{cos(180*\x/3.1415)}) [below left]
{$\min(f(x),g(x))$};
\node[color=purple!50] at ({0.25*3.1415},0.7) [above right]
{$\frac12(f(x)+g(x))$};
\draw[->] (-0.1,0) -- (6.5,0) coordinate[label={$x$}];
\draw[->] (0,-1.1) -- (0,1.3) coordinate[label={right:$y$}];
\end{scope}
\end{tikzpicture}
\end{document}
|