<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Forum Bauen und Umwelt - Gleichgewicht, Schwerpunkt  und Hebelarm an einer Balkenwaage</title>
<link>https://bauforum.wirklichewelt.de/</link>
<description>Das Bauforum</description>
<language>de</language>
<item>
<title>Gleichgewicht, Schwerpunkt  und Hebelarm an einer Balkenwaage</title>
<content:encoded><![CDATA[<p>Dieses Python-3-Programm mit Tkinter-Grafik und Mausbedienung über Schieberegler war in ähnlicher Form im vergangenen Jahr die Beispiellösung für die Programmieraufgabe im ersten Semester. Eine Balkenwaage hat vier mit der Maus beeinflussbare Parameter: die Längen der beiden Balkenarme und die Massen am jeweiligen Armende. Die Schieber sind so angeordnet, dass die Bedienung möglichst intuitiv ist. Die Regler für die Längen sind horizontal angeordnet und entgegengesetzt skaliert, die Regler für die Massen sind vertikal angeordnet.</p>
<p>Die Beschriftung der einzelnen Komponenten wird dynamisch an die sich ändernde Geometrie der Anordnung angepasst und auch eine gedrehte Beschriftung kommt vor. Ein (minimaler) 3D-Effekt wird durch einen Stapel immer heller und kleiner werdender Kreisscheiben erzielt, die eine Art Glanzpunkt auf den Massekugeln darstellen.</p>
<p><img src="https://bauforum.wirklichewelt.de/images/uploaded/Bild_JE2VFG7P1.png" alt="[image]"  /></p>
<p>Download: <a href="images/uploaded/ZIP-Archiv_F8RAASYL1.zip" target="_blank"><img src="img/zip.png" alt="[image]"  />ZIP-Archiv_F8RAASYL1.zip</a></p>
<pre class="python" style="font-family:monospace;"><ol><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Simulation einer Balkenwaage</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Die Massen an den Balkenenden sowie die Längen der Waagbalkenhälften</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># sind variabel und können mit Schiebereglern beeinflusst werden.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Durch Rechtsklick auf einen Schieberegler lässt sich die Waage wieder</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># ins Gleichgewicht bringen.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> tkinter <span style="color: #ff7700;">import</span> Tk<span style="color: #000;">,</span> Canvas<span style="color: #000;">,</span> Label<span style="color: #000;">,</span> Entry<span style="color: #000;">,</span> Scale<span style="color: #000;">,</span> mainloop<span style="color: #000;">,</span> messagebox</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;">import</span> sin<span style="color: #000;">,</span> cos<span style="color: #000;">,</span> atan2<span style="color: #000;">,</span> degrees<span style="color: #000;">,</span> hypot</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Programmfenster einrichten</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T <span style="color: #000;">=</span> Tk<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">title</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Gleichgewicht und Schwerpunkt&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Zeichenfläche definieren</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">C <span style="color: #000;">=</span> Canvas<span style="color: black;">&#40;</span>T<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">800</span><span style="color: #000;">,</span> height<span style="color: #000;">=</span><span style="color: #008;">600</span><span style="color: #000;">,</span> bg<span style="color: #000;">=</span><span style="color: #080;">&quot;white&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">C.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> columnspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> rowspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> kreis<span style="color: black;">&#40;</span>p<span style="color: #000;">,</span> r<span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;black&quot;</span><span style="color: #000;">,</span> outline<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Zeichnet Kreis um Punkt p mit Radius r&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Falls Randfarbe nicht angegeben wurde, entspricht sie der Füllfarbe.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> <span style="color: #ff7700;">not</span> outline:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        outline <span style="color: #000;">=</span> fill</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Der Kreis wird über das ihn umschließende Quadrat definiert.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_oval</span><span style="color: black;">&#40;</span>p<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>-r<span style="color: #000;">,</span> p<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>-r<span style="color: #000;">,</span> p<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>+r<span style="color: #000;">,</span> p<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>+r<span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  fill<span style="color: #000;">=</span>fill<span style="color: #000;">,</span> outline<span style="color: #000;">=</span>outline<span style="color: #000;">,</span> width<span style="color: #000;">=</span>width<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> kugel<span style="color: black;">&#40;</span>p<span style="color: #000;">,</span> m<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Zeichnet Kugel der Masse m an Punkt p&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Der Radius ist proportional zur dritten Wurzel der Masse.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    r <span style="color: #000;">=</span> m**<span style="color: black;">&#40;</span><span style="color: #008;">1</span>/<span style="color: #008;">3</span><span style="color: black;">&#41;</span>*<span style="color: #008;">10</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Die Kreisscheibe ist rot.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    kreis<span style="color: black;">&#40;</span>p<span style="color: #000;">,</span> r<span style="color: #000;">,</span> <span style="color: #080;">&quot;#E00000&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Oben links befindet sich ein kleiner Glanzpunkt. Er besteht aus</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># vielen Kreisen, die immer heller und immer kleiner werden.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">for</span> ri <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #808;">int</span><span style="color: black;">&#40;</span>r/<span style="color: #008;">2</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span> <span style="color: #008;">0</span><span style="color: #000;">,</span> -<span style="color: #008;">1</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        pi <span style="color: #000;">=</span> <span style="color: black;">&#40;</span>p<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>-r/<span style="color: #008;">3</span><span style="color: #000;">,</span> p<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>-r/<span style="color: #008;">3</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        fi <span style="color: #000;">=</span> <span style="color: #080;">&quot;#E0%02X%02X&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #808;">int</span><span style="color: black;">&#40;</span><span style="color: #008;">180</span>*<span style="color: black;">&#40;</span><span style="color: #008;">1</span>-<span style="color: #008;">2</span>*ri/r<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span><span style="color: #008;">180</span>*<span style="color: black;">&#40;</span><span style="color: #008;">1</span>-<span style="color: #008;">2</span>*ri/r<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        kreis<span style="color: black;">&#40;</span>pi<span style="color: #000;">,</span> ri<span style="color: #000;">,</span> fi<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Beschriftung</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_text</span><span style="color: black;">&#40;</span>p<span style="color: #000;">,</span> text<span style="color: #000;">=</span>m<span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;white&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> zeichnung<span style="color: black;">&#40;</span>event<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Baut die Zeichnung komplett neu auf&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">delete</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;all&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Maßstab: 1 Meter entspricht 30 Pixeln</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    m <span style="color: #000;">=</span> <span style="color: #008;">30</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Höhe des senkrechten Aufhängestabes</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    h <span style="color: #000;">=</span> <span style="color: #008;">0.1</span> * m</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Fadenlänge der aufgehängten Massen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #dc143c;">fl</span> <span style="color: #000;">=</span> <span style="color: #008;">3</span>*m</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Massen links/rechts von Schiebereglern ablesen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    lm <span style="color: #000;">=</span> S_LMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    rm <span style="color: #000;">=</span> S_RMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Längen links/rechts von Schiebereglern ablesen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ll <span style="color: #000;">=</span> S_LLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    rl <span style="color: #000;">=</span> S_RLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Schwerpunktordinate auf dem Waagbalken</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">try</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        s <span style="color: #000;">=</span> rm/<span style="color: black;">&#40;</span>lm+rm<span style="color: black;">&#41;</span>*<span style="color: black;">&#40;</span>ll+rl<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">except</span> <span style="color: #808;">ZeroDivisionError</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">create_text</span><span style="color: black;">&#40;</span><span style="color: #008;">400</span><span style="color: #000;">,</span> <span style="color: #008;">100</span><span style="color: #000;">,</span> text<span style="color: #000;">=</span><span style="color: #080;">&quot;Eine der beiden Massen muss größer als&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                      <span style="color: #080;">&quot; null sein.&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">return</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Startpunkt (Gelenkige Aufhängung)</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    p0 <span style="color: #000;">=</span> x0<span style="color: #000;">,</span> y0 <span style="color: #000;">=</span> <span style="color: #008;">400</span><span style="color: #000;">,</span> <span style="color: #008;">100</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Winkel der Waage</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    alpha <span style="color: #000;">=</span> atan2<span style="color: black;">&#40;</span>s-ll<span style="color: #000;">,</span> h<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Hypotenuse des rechtwinkligen Dreiecks</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Aufhängepunkt-Schwerpunkt-Balkenschnittpunkt</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    hyp <span style="color: #000;">=</span> h*m/cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span>+<span style="color: #dc143c;">fl</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Schwerpunkt</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    ps <span style="color: #000;">=</span> x0<span style="color: #000;">,</span> y0+hyp</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Schnittpunkt von Aufhängestab und Waagbalken</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    p1 <span style="color: #000;">=</span> x0-h*m*sin<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: #000;">,</span> y0+h*m*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Punkt des rechten Winkels im blauen Schwerpunktdreieck</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pw <span style="color: #000;">=</span> x0-hyp*sin<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span>*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: #000;">,</span> y0+hyp*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span>*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Linker Endpunkt des Waagbalkens</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pl <span style="color: #000;">=</span> p1<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>-ll*m*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: #000;">,</span> p1<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>-ll*m*sin<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Rechter Endpunkt des Waagbalkens</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pr <span style="color: #000;">=</span> p1<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>+rl*m*cos<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: #000;">,</span> p1<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>+rl*m*sin<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Aufhängestab</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_line</span><span style="color: black;">&#40;</span>p0<span style="color: #000;">,</span> p1<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;brown&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Gelenkige Aufhängung</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    kreis<span style="color: black;">&#40;</span>p0<span style="color: #000;">,</span> <span style="color: #008;">0.3</span>*m<span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;white&quot;</span><span style="color: #000;">,</span> outline<span style="color: #000;">=</span><span style="color: #080;">&quot;black&quot;</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">4</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Waagbalken</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_line</span><span style="color: black;">&#40;</span>pl<span style="color: #000;">,</span> pr<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> capstyle<span style="color: #000;">=</span><span style="color: #080;">&quot;round&quot;</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;brown&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Linke Masse</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pl1 <span style="color: #000;">=</span> pl<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: #000;">,</span> pl<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>+<span style="color: #dc143c;">fl</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_line</span><span style="color: black;">&#40;</span>pl<span style="color: #000;">,</span> pl1<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    kugel<span style="color: black;">&#40;</span>pl1<span style="color: #000;">,</span> lm<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Rechte Masse</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    pr1 <span style="color: #000;">=</span> pr<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: #000;">,</span> pr<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>+<span style="color: #dc143c;">fl</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_line</span><span style="color: black;">&#40;</span>pr<span style="color: #000;">,</span> pr1<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    kugel<span style="color: black;">&#40;</span>pr1<span style="color: #000;">,</span> rm<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Schwerpunkt zeichnen und beschriften</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    kreis<span style="color: black;">&#40;</span>ps<span style="color: #000;">,</span> <span style="color: #008;">3</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_text</span><span style="color: black;">&#40;</span>x0<span style="color: #000;">,</span> y0+hyp+<span style="color: #008;">5</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  text<span style="color: #000;">=</span><span style="color: #080;">&quot;Schwerpunkt&quot;</span><span style="color: #000;">,</span> anchor<span style="color: #000;">=</span><span style="color: #080;">&quot;n&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Winkel einzeichnen:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Das blaue Dreieck</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_polygon</span><span style="color: black;">&#40;</span>p0<span style="color: #000;">,</span> ps<span style="color: #000;">,</span> pw<span style="color: #000;">,</span> outline<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Der Maßbogen des Winkels</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_arc</span><span style="color: black;">&#40;</span>x0-<span style="color: #008;">2.5</span>*m<span style="color: #000;">,</span> y0-<span style="color: #008;">2.5</span>*m<span style="color: #000;">,</span> x0+<span style="color: #008;">2.5</span>*m<span style="color: #000;">,</span> y0+<span style="color: #008;">2.5</span>*m<span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 style<span style="color: #000;">=</span><span style="color: #080;">&quot;arc&quot;</span><span style="color: #000;">,</span> outline<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 start<span style="color: #000;">=</span><span style="color: #008;">270</span><span style="color: #000;">,</span> extent<span style="color: #000;">=</span>-degrees<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Die Pfeilspitze des Maßbogens nur bei ausreichend großem Winkel zeichnen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> <span style="color: #808;">abs</span><span style="color: black;">&#40;</span>degrees<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #000;">&gt;</span> <span style="color: #008;">5</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        x2 <span style="color: #000;">=</span> x0+<span style="color: #008;">10</span> <span style="color: #ff7700;">if</span> alpha <span style="color: #000;">&lt;</span> <span style="color: #008;">0</span> <span style="color: #ff7700;">else</span> x0-<span style="color: #008;">10</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        y2 <span style="color: #000;">=</span> y0+<span style="color: #008;">2.5</span>*m</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">create_polygon</span><span style="color: black;">&#40;</span>x2<span style="color: #000;">,</span> y2-<span style="color: #008;">5</span><span style="color: #000;">,</span> x0<span style="color: #000;">,</span> y2<span style="color: #000;">,</span> x2<span style="color: #000;">,</span> y2+<span style="color: #008;">3</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Winkelbemaßung je nach Vorzeichen links- oder rechtsbündig</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    C.<span style="color: black;">create_text</span><span style="color: black;">&#40;</span>x0<span style="color: #000;">,</span> y0+<span style="color: #008;">2.5</span>*m<span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  text<span style="color: #000;">=</span><span style="color: #080;">&quot; α = %.2f° &quot;</span> % <span style="color: #808;">abs</span><span style="color: black;">&#40;</span>degrees<span style="color: black;">&#40;</span>alpha<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  anchor<span style="color: #000;">=</span><span style="color: #080;">&quot;e&quot;</span> <span style="color: #ff7700;">if</span> alpha <span style="color: #000;">&lt;</span> <span style="color: #008;">0</span> <span style="color: #ff7700;">else</span> <span style="color: #080;">&quot;w&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Schwerpunktabstand (falls kein Gleichgewicht) beschriften</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> alpha:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        sa <span style="color: #000;">=</span> hypot<span style="color: black;">&#40;</span>ps<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>-pw<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: #000;">,</span> ps<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>-pw<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>/m</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">create_text</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>ps<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span>+pw<span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>/<span style="color: #008;">2</span><span style="color: #000;">,</span> <span style="color: black;">&#40;</span>ps<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span>+pw<span style="color: black;">&#91;</span><span style="color: #008;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>/<span style="color: #008;">2</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                      anchor<span style="color: #000;">=</span><span style="color: #080;">&quot;s&quot;</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;blue&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                      angle<span style="color: #000;">=</span>degrees<span style="color: black;">&#40;</span>-alpha<span style="color: black;">&#41;</span><span style="color: #000;">,</span> text<span style="color: #000;">=</span><span style="color: #080;">&quot;%.2fm&quot;</span> % sa<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Eingabebereich: Jeder Schieberegler lässt sich mit Rechtsklick</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># in die Gleichgewichtslage zurücksetzen (falls möglich).</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Vertikaler linker Regler</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Label<span style="color: black;">&#40;</span>text<span style="color: #000;">=</span><span style="color: #080;">&quot;linke Massen[kg]&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LMasse <span style="color: #000;">=</span> Scale<span style="color: black;">&#40;</span>from_<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> to<span style="color: #000;">=</span><span style="color: #008;">99</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">20</span><span style="color: #000;">,</span> orient<span style="color: #000;">=</span><span style="color: #080;">&quot;vertical&quot;</span><span style="color: #000;">,</span> length<span style="color: #000;">=</span><span style="color: #008;">500</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 tickinterval<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> resolution<span style="color: #000;">=</span><span style="color: #008;">0.1</span><span style="color: #000;">,</span> command<span style="color: #000;">=</span>zeichnung<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LMasse.<span style="color: #808;">set</span><span style="color: black;">&#40;</span><span style="color: #008;">10</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LMasse.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ns&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> reset_LMasse<span style="color: black;">&#40;</span>event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    S_LMasse.<span style="color: #808;">set</span><span style="color: black;">&#40;</span>S_RMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>*S_RLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>/S_LLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    zeichnung<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LMasse.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;Button-3&gt;&quot;</span><span style="color: #000;">,</span> reset_LMasse<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Vertikaler rechter Regler</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Label<span style="color: black;">&#40;</span>text<span style="color: #000;">=</span><span style="color: #080;">&quot;rechte Massen[kg]&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">3</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RMasse <span style="color: #000;">=</span> Scale<span style="color: black;">&#40;</span>from_<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> to<span style="color: #000;">=</span><span style="color: #008;">99</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">20</span><span style="color: #000;">,</span> orient<span style="color: #000;">=</span><span style="color: #080;">&quot;vertical&quot;</span><span style="color: #000;">,</span> length<span style="color: #000;">=</span><span style="color: #008;">500</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 tickinterval<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> resolution<span style="color: #000;">=</span><span style="color: #008;">0.1</span><span style="color: #000;">,</span> command<span style="color: #000;">=</span>zeichnung<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RMasse.<span style="color: #808;">set</span><span style="color: black;">&#40;</span><span style="color: #008;">10</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RMasse.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">3</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ns&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> reset_RMasse<span style="color: black;">&#40;</span>event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    S_RMasse.<span style="color: #808;">set</span><span style="color: black;">&#40;</span>S_LMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>*S_LLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>/S_RLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    zeichnung<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RMasse.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;Button-3&gt;&quot;</span><span style="color: #000;">,</span> reset_RMasse<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Horizontaler linker Regler</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Label<span style="color: black;">&#40;</span>text<span style="color: #000;">=</span><span style="color: #080;">&quot;Länge des linken Waagbalkenarmesn[m]&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: black;">&#41;</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">3</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> columnspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LLänge <span style="color: #000;">=</span> Scale<span style="color: black;">&#40;</span>from_<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> to<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">20</span><span style="color: #000;">,</span> orient<span style="color: #000;">=</span><span style="color: #080;">&quot;horizontal&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 tickinterval<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> resolution<span style="color: #000;">=</span><span style="color: #008;">0.1</span><span style="color: #000;">,</span> command<span style="color: #000;">=</span>zeichnung<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LLänge.<span style="color: #808;">set</span><span style="color: black;">&#40;</span><span style="color: #008;">5</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LLänge.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">4</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: #000;">,</span> columnspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> reset_LLänge<span style="color: black;">&#40;</span>event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> S_LMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        S_LLänge.<span style="color: #808;">set</span><span style="color: black;">&#40;</span>S_RLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>*S_RMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>/S_LMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        zeichnung<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_LLänge.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;Button-3&gt;&quot;</span><span style="color: #000;">,</span> reset_LLänge<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Horizontaler rechter Regler</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Label<span style="color: black;">&#40;</span>text<span style="color: #000;">=</span><span style="color: #080;">&quot;Länge des rechten Waagbalkenarmesn[m]&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: black;">&#41;</span>.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">3</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> columnspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RLänge <span style="color: #000;">=</span> Scale<span style="color: black;">&#40;</span>from_<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> to<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">20</span><span style="color: #000;">,</span> orient<span style="color: #000;">=</span><span style="color: #080;">&quot;horizontal&quot;</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 tickinterval<span style="color: #000;">=</span><span style="color: #008;">1</span><span style="color: #000;">,</span> resolution<span style="color: #000;">=</span><span style="color: #008;">0.1</span><span style="color: #000;">,</span> command<span style="color: #000;">=</span>zeichnung<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RLänge.<span style="color: #808;">set</span><span style="color: black;">&#40;</span><span style="color: #008;">5</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RLänge.<span style="color: black;">grid</span><span style="color: black;">&#40;</span>row<span style="color: #000;">=</span><span style="color: #008;">4</span><span style="color: #000;">,</span> column<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> columnspan<span style="color: #000;">=</span><span style="color: #008;">2</span><span style="color: #000;">,</span> sticky<span style="color: #000;">=</span><span style="color: #080;">&quot;ew&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> reset_RLänge<span style="color: black;">&#40;</span>event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">if</span> S_RMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        S_RLänge.<span style="color: #808;">set</span><span style="color: black;">&#40;</span>S_LLänge.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>*S_LMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>/S_RMasse.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        zeichnung<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">S_RLänge.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;Button-3&gt;&quot;</span><span style="color: #000;">,</span> reset_RLänge<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Anfangsdarstellung</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">zeichnung<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mainloop<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li></ol></pre>]]></content:encoded>
<link>https://bauforum.wirklichewelt.de/index.php?id=11462</link>
<guid>https://bauforum.wirklichewelt.de/index.php?id=11462</guid>
<pubDate>Sun, 08 Jan 2017 21:21:42 +0000</pubDate>
<category>Software</category><dc:creator>Martin Vogel</dc:creator>
</item>
</channel>
</rss>
