Rob Keij
Honourable Member
Wet van ohm wiel, makkelijk voor documentatie in Latex (TeX-macrotaal)
Voor een documentatie had ik een wet van Ohm wiel nodig en wilde een eigen plaatje maken.
Een formule plaatje wat altijd makkelijk is om bij de hand te hebben.
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[scale=4, font=\sffamily\normalsize]
% Define colors
\definecolor{lightpink}{RGB}{255,192,203}
\definecolor{lightpurple}{RGB}{200,162,200}
\definecolor{lightyellow}{RGB}{255,250,205}
\definecolor{lightorange}{RGB}{255,200,150}
\definecolor{lightgreen}{RGB}{152,251,152}
\definecolor{darkgreen}{RGB}{60,179,113}
\definecolor{lightblue}{RGB}{173,216,230}
\definecolor{lightlavender}{RGB}{200,180,230}
% Radii (maak centreren overal consistent)
\def\Rin{1}
\def\Rout{1.5}
\def\Rlabel{1.25} % midden tussen 1 en 1.5
% Style voor formulelabels
\tikzset{
formula/.style={
draw=none,
fill=none,
align=center,
anchor=center,
inner sep=1pt
}
}
% Outer ring segments (12 segments - 3 per quarter)
% Top-left pink quadrant (I formulas)
\fill[lightpink] (120:\Rin) -- (120:\Rout) arc (120:150:\Rout) -- (150:\Rin) arc (150:120:\Rin) -- cycle;
\node[formula] at (135:\Rlabel) {$I=\dfrac{U}{R}$};
\fill[lightpink] (150:\Rin) -- (150:\Rout) arc (150:180:\Rout) -- (180:\Rin) arc (180:150:\Rin) -- cycle;
\node[formula] at (165:\Rlabel) {$I=\dfrac{P}{U}$};
\fill[lightpink] (90:\Rin) -- (90:\Rout) arc (90:120:\Rout) -- (120:\Rin) arc (120:90:\Rin) -- cycle;
\node[formula] at (105:\Rlabel) {$I=\sqrt{\dfrac{P}{R}}$};
% Top-right (U formulas)
\fill[lightyellow] (60:\Rin) -- (60:\Rout) arc (60:90:\Rout) -- (90:\Rin) arc (90:60:\Rin) -- cycle;
\node[formula] at (75:\Rlabel) {$U=\sqrt{P\times R}$};
\fill[lightyellow] (30:\Rin) -- (30:\Rout) arc (30:60:\Rout) -- (60:\Rin) arc (60:30:\Rin) -- cycle;
\node[formula] at (45:\Rlabel) {$U=\dfrac{P}{I}$};
\fill[lightyellow] (0:\Rin) -- (0:\Rout) arc (0:30:\Rout) -- (30:\Rin) arc (30:0:\Rin) -- cycle;
\node[formula] at (15:\Rlabel) {$U=I\times R$};
% Bottom-right (R formulas)
\fill[lightlavender] (330:\Rin) -- (330:\Rout) arc (330:360:\Rout) -- (360:\Rin) arc (360:330:\Rin) -- cycle;
\node[formula] at (345:\Rlabel) {$R=\dfrac{U}{I}$};
\fill[lightlavender] (300:\Rin) -- (300:\Rout) arc (300:330:\Rout) -- (330:\Rin) arc (330:300:\Rin) -- cycle;
\node[formula] at (315:\Rlabel) {$R=\dfrac{U^{2}}{P}$};
\fill[lightlavender] (270:\Rin) -- (270:\Rout) arc (270:300:\Rout) -- (300:\Rin) arc (300:270:\Rin) -- cycle;
\node[formula] at (285:\Rlabel) {$R=\dfrac{P}{I^{2}}$};
% Bottom-left (P formulas)
\fill[lightgreen] (180:\Rin) -- (180:\Rout) arc (180:210:\Rout) -- (210:\Rin) arc (210:180:\Rin) -- cycle;
\node[formula] at (195:\Rlabel) {$P=U\times I$};
\fill[lightgreen] (210:\Rin) -- (210:\Rout) arc (210:240:\Rout) -- (240:\Rin) arc (240:210:\Rin) -- cycle;
\node[formula] at (225:\Rlabel) {$P=I^{2}\times R$};
\fill[lightgreen] (240:\Rin) -- (240:\Rout) arc (240:270:\Rout) -- (270:\Rin) arc (270:240:\Rin) -- cycle;
\node[formula] at (255:\Rlabel) {$P=\dfrac{U^{2}}{R}$};
% Inner circle segments
\fill[lightpurple] (90:0) -- (90:1) arc (90:180:1) -- (180:0) -- cycle;
\node[draw=none, fill=none, inner sep=0pt, font=\sffamily\Huge\bfseries] at (135:0.5) {I};
\fill[darkgreen] (180:0) -- (180:1) arc (180:270:1) -- (270:0) -- cycle;
\node[draw=none, fill=none, inner sep=0pt, font=\sffamily\Huge\bfseries, ] at (225:0.5) {P};
\fill[lightblue] (270:0) -- (270:1) arc (270:360:1) -- (360:0) -- cycle;
\node[draw=none, fill=none, inner sep=0pt, font=\sffamily\Huge\bfseries] at (315:0.5) {R};
\fill[lightorange] (0:0) -- (0:1) arc (0:90:1) -- (90:0) -- cycle;
\node[draw=none, fill=none, inner sep=0pt, font=\sffamily\Huge\bfseries] at (45:0.5) {U};
% Outer segment separators
\foreach \angle in {0,30,60,90,120,150,180,210,240,270,300,330} {
\draw[white, line width=1.5pt] (\angle:\Rin) -- (\angle:\Rout);
}
% Circles
\draw[white, line width=1.5pt] (0,0) circle (\Rin);
\draw[white, line width=1.5pt] (0,0) circle (\Rout);
\end{tikzpicture}
\end{document}
Arco
Special Member
Arco - "Simplicity is a prerequisite for reliability" - hard-, firm-, en software ontwikkeling: www.arcovox.com
Rob Keij
Honourable Member
Ja ook nuttig
(Fouten zijn gecorrigeerd , dank je arco)
\documentclass[border=8mm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{xcolor} % veilig voor kleuren
\newcommand{\ohmslawcircleextended}{%
\begin{tikzpicture}[scale=3, font=\sffamily\scriptsize]
% Colors
\definecolor{lightpink}{RGB}{255,192,203}
\definecolor{lightpurple}{RGB}{200,162,200}
\definecolor{lightyellow}{RGB}{255,250,205}
\definecolor{lightorange}{RGB}{255,200,150}
\definecolor{lightgreen}{RGB}{152,251,152}
\definecolor{darkgreen}{RGB}{60,179,113}
\definecolor{lightblue}{RGB}{173,216,230}
\definecolor{lightlavender}{RGB}{200,180,230}
% Radii
\def\Rin{1}
\def\Rout{1.5}
\def\Rlabel{1.25}
% Extra outer ring (unit/prefix blocks)
\def\RinOuter{1.5}
\defRoutOuter{2.25}
\def\RlabelOuter{1.87}
% Styles
\tikzset{
formula/.style={draw=none, fill=none, align=center, anchor=center, inner sep=1pt},
ublock/.style={draw=none, fill=none, align=center, anchor=center, inner sep=1pt,
font=\sffamily\tiny, text width=2.2cm}
}
% OUTER RING (12 blocks)
\foreach \a/\b/\txt in {
120/150/{A=A\cdot\Omega\\ mA=mA\cdot\Omega\\ A=mA\cdot k\Omega},
150/180/{A=\dfrac{W}{A}\\ mA=\dfrac{mW}{A}\\ A=\dfrac{mW}{mA}},
90/120/{A=\sqrt{W\cdot\Omega}\\ A=\sqrt{mW\cdot k\Omega}\\ mA=\sqrt{\mu W\cdot\Omega}},
60/90/{V=\dfrac{V}{\Omega}\\ mV=\dfrac{mV}{\Omega}\\ \mu V=\dfrac{V}{M\Omega}},
30/60/{V=\dfrac{W}{V}\\ mV=\dfrac{mW}{V}\\ V=\dfrac{mW}{mV}},
0/30/{V=\sqrt{\dfrac{W}{\Omega}}\\ mV=\sqrt{\dfrac{mW}{k\Omega}}\\ \mu V=\sqrt{\dfrac{\mu W}{M\Omega}}},
330/360/{\Omega=\dfrac{V}{A}\\ k\Omega=\dfrac{V}{mA}\\ M\Omega=\dfrac{V}{\mu A}},
300/330/{\Omega=\dfrac{V^{2}}{W}\\ k\Omega=\dfrac{V^{2}}{mW}\\ M\Omega=\dfrac{V^{2}}{\mu W}},
270/300/{\Omega=\dfrac{W}{A^{2}}\\ k\Omega=\dfrac{mW}{mA^{2}}\\ M\Omega=\dfrac{\mu W}{\mu A^{2}}},
180/210/{W=V\cdot A\\ mW=V\cdot mA\\ \mu W=mV\cdot mA},
210/240/{W=A^{2}\cdot\Omega\\ mW=mA^{2}\cdot k\Omega\\ \mu W=\mu A^{2}\cdot M\Omega},
240/270/{W=\dfrac{V^{2}}{\Omega}\\ mW=\dfrac{V^{2}}{k\Omega}\\ \mu W=\dfrac{V^{2}}{M\Omega}}
}{
\fill[white] (\a:\RinOuter) -- (\a:RoutOuter) arc (\a:\b:RoutOuter) -- (\b:\RinOuter) arc (\b:\a:\RinOuter) -- cycle;
% FIX: multiline math -> gathered
\node[ublock] at ({(\a+\b)/2}:\RlabelOuter) {$\begin{gathered}\txt\end{gathered}$};
}
\foreach \angle in {0,30,60,90,120,150,180,210,240,270,300,330} {
\draw[black!35, line width=0.9pt] (\angle:\RinOuter) -- (\angle:RoutOuter);
}
\draw[black!35, line width=0.9pt] (0,0) circle (\RinOuter);
\draw[black!35, line width=0.9pt] (0,0) circle (RoutOuter);
% MIDDLE RING
\fill[lightpink] (120:\Rin) -- (120:\Rout) arc (120:150:\Rout) -- (150:\Rin) arc (150:120:\Rin) -- cycle;
\node[formula] at (135:\Rlabel) {$I=\dfrac{U}{R}$};
\fill[lightpink] (150:\Rin) -- (150:\Rout) arc (150:180:\Rout) -- (180:\Rin) arc (180:150:\Rin) -- cycle;
\node[formula] at (165:\Rlabel) {$I=\dfrac{P}{U}$};
\fill[lightpink] (90:\Rin) -- (90:\Rout) arc (90:120:\Rout) -- (120:\Rin) arc (120:90:\Rin) -- cycle;
\node[formula] at (105:\Rlabel) {$I=\sqrt{\dfrac{P}{R}}$};
\fill[lightyellow] (60:\Rin) -- (60:\Rout) arc (60:90:\Rout) -- (90:\Rin) arc (90:60:\Rin) -- cycle;
\node[formula] at (75:\Rlabel) {$U=\sqrt{P\cdot R}$};
\fill[lightyellow] (30:\Rin) -- (30:\Rout) arc (30:60:\Rout) -- (60:\Rin) arc (60:30:\Rin) -- cycle;
\node[formula] at (45:\Rlabel) {$U=\dfrac{P}{I}$};
\fill[lightorange] (0:\Rin) -- (0:\Rout) arc (0:30:\Rout) -- (30:\Rin) arc (30:0:\Rin) -- cycle;
\node[formula] at (15:\Rlabel) {$U=I\cdot R$};
\fill[lightlavender] (330:\Rin) -- (330:\Rout) arc (330:360:\Rout) -- (360:\Rin) arc (360:330:\Rin) -- cycle;
\node[formula] at (345:\Rlabel) {$R=\dfrac{U}{I}$};
\fill[lightlavender] (300:\Rin) -- (300:\Rout) arc (300:330:\Rout) -- (330:\Rin) arc (330:300:\Rin) -- cycle;
\node[formula] at (315:\Rlabel) {$R=\dfrac{U^{2}}{P}$};
\fill[lightlavender] (270:\Rin) -- (270:\Rout) arc (270:300:\Rout) -- (300:\Rin) arc (300:270:\Rin) -- cycle;
\node[formula] at (285:\Rlabel) {$R=\dfrac{P}{I^{2}}$};
\fill[lightgreen] (180:\Rin) -- (180:\Rout) arc (180:210:\Rout) -- (210:\Rin) arc (210:180:\Rin) -- cycle;
\node[formula] at (195:\Rlabel) {$P=U\cdot I$};
\fill[lightgreen] (210:\Rin) -- (210:\Rout) arc (210:240:\Rout) -- (240:\Rin) arc (240:210:\Rin) -- cycle;
\node[formula] at (225:\Rlabel) {$P=I^{2}\cdot R$};
\fill[lightgreen] (240:\Rin) -- (240:\Rout) arc (240:270:\Rout) -- (270:\Rin) arc (270:240:\Rin) -- cycle;
\node[formula] at (255:\Rlabel) {$P=\dfrac{U^{2}}{R}$};
\foreach \angle in {0,30,60,90,120,150,180,210,240,270,300,330} {
\draw[white, line width=1.5pt] (\angle:\Rin) -- (\angle:\Rout);
}
\draw[white, line width=1.5pt] (0,0) circle (\Rin);
\draw[white, line width=1.5pt] (0,0) circle (\Rout);
% INNER QUADRANTS (no boxes)
\fill[lightpurple] (90:0) -- (90:1) arc (90:180:1) -- (180:0) -- cycle;
\node[draw=none, fill=none, font=\sffamily\Large\bfseries] at (135:0.55) {I};
\fill[darkgreen] (180:0) -- (180:1) arc (180:270:1) -- (270:0) -- cycle;
\node[draw=none, fill=none, font=\sffamily\Large\bfseries] at (225:0.55) {P};
\fill[lightblue] (270:0) -- (270:1) arc (270:360:1) -- (360:0) -- cycle;
\node[draw=none, fill=none, font=\sffamily\Large\bfseries] at (315:0.55) {R};
\fill[lightorange] (0:0) -- (0:1) arc (0:90:1) -- (90:0) -- cycle;
\node[draw=none, fill=none, font=\sffamily\Large\bfseries] at (45:0.55) {U};
\end{tikzpicture}%
}
\begin{document}
\ohmslawcircleextended
\end{document}
Arco
Special Member
Arco - "Simplicity is a prerequisite for reliability" - hard-, firm-, en software ontwikkeling: www.arcovox.com
De 'A' en 'V' formules hebben van plaats gewisseld in je laatste 'wiel' ... 
(V hoort bij 'U', en A hoort bij 'I'...)
Mijn ervaring: als je vaak het wiel gebruikt kun je steeds minder goed uit het hoofd afleiden. Ik onthoud UIR en PUI.
