<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[complex Imaginärteil]]></title><description><![CDATA[<p>Hallo<br />
Ich habe folgenden code:</p>
<pre><code class="language-cpp">...
double R,C,omega;
complex&lt;double&gt; Zs;
...
Zs = R + 1.0/(omega*C);
...
</code></pre>
<p>Meine Frage ist jetzt, wie teile ich dem Compiler mit dass 1.0/(omega*C) Imaginärteil ist ?</p>
<p>Wäre dankbar für die Antwort auf diese Frage.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158984/complex-imaginärteil</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 07:44:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158984.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Sep 2006 06:56:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 06:56:10 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich habe folgenden code:</p>
<pre><code class="language-cpp">...
double R,C,omega;
complex&lt;double&gt; Zs;
...
Zs = R + 1.0/(omega*C);
...
</code></pre>
<p>Meine Frage ist jetzt, wie teile ich dem Compiler mit dass 1.0/(omega*C) Imaginärteil ist ?</p>
<p>Wäre dankbar für die Antwort auf diese Frage.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134895</guid><dc:creator><![CDATA[Marcin]]></dc:creator><pubDate>Mon, 11 Sep 2006 06:56:10 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 08:13:54 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Zs = complex(R, 1.0/(omega*C));<br />
oder gleich im Konstruktor initialisieren wenn möglich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134946</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134946</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 11 Sep 2006 08:13:54 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 14:23:22 GMT]]></title><description><![CDATA[<p>Viele dank fuer Antwort.</p>
<p>Mit complex&lt;double&gt;(0, 1.0/(omega*L)) geht es natürlich auch.<br />
Gibt es vielleicht auch eine C++ Methode um es wie in C einzugeben ?</p>
<pre><code class="language-cpp">//Wie geht so was in C++?
Zs = R + I*(1.0/(omega*C));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1135224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135224</guid><dc:creator><![CDATA[Marcin]]></dc:creator><pubDate>Mon, 11 Sep 2006 14:23:22 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 14:42:53 GMT]]></title><description><![CDATA[<p>Was meinst du jetzt wie in C eingeben? Die Formel da? Die kannst du in C++ genauso hinschreiben wenn I auch vom Typ complex ist.<br />
Was für einen Datentyp nimmst du in C statt complex dafü?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135238</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 11 Sep 2006 14:42:53 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 15:17:47 GMT]]></title><description><![CDATA[<p>Marcin schrieb:</p>
<blockquote>
<p>Viele dank fuer Antwort.</p>
<p>Mit complex&lt;double&gt;(0, 1.0/(omega*L)) geht es natürlich auch.<br />
Gibt es vielleicht auch eine C++ Methode um es wie in C einzugeben ?</p>
<pre><code class="language-cpp">//Wie geht so was in C++?
Zs = R + I*(1.0/(omega*C));
</code></pre>
</blockquote>
<p>Ganz einfach:</p>
<pre><code class="language-cpp">const complex&lt;double&gt; I(0,1);
</code></pre>
<p>mal vorher irgendwann hinschreiben. Kostet Dich allerdings wohl etwas Laufzeit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135286</guid><dc:creator><![CDATA[Jester]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 15:25:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/1387">@Braunstein</a><br />
Wie du sicher weiss kann man in C folgendes schreiben:</p>
<pre><code class="language-cpp">complex double Zs;
Zs = R + I*(1.0/(omega*C));
</code></pre>
<p>R ist realteil, 1.0/(omega*C) ist (wegen I*) Imaginärteil.<br />
Diese Schreibweise finde ich sehr elegant und würde sie gerne auch in C++ verwenden (oder etwas gleichwertiges).<br />
Mit konstante geht es auch:</p>
<pre><code class="language-cpp">Zs = 4 + 4i
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1135290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135290</guid><dc:creator><![CDATA[Marcin]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:25:49 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 15:25:06 GMT]]></title><description><![CDATA[<p>Marcin schrieb:</p>
<blockquote>
<p>Diese Schreibweise finde ich sehr elegant und würde sie gerne auch in C++ verwenden (oder etwas gleichwertiges).</p>
</blockquote>
<p>Ich hab doch gerade beschrieben wie das geht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135295</guid><dc:creator><![CDATA[Jester]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:25:06 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 15:44:32 GMT]]></title><description><![CDATA[<p>Hallo Jester</p>
<p>Ich schrieb mein Beitrag genau zu gleichen Zeit wie du als Antwort auf für Braunstein.</p>
<p>Ansonsten dein Vorschlag klingt logisch aber ich habe ihn nicht zu ende verstanden, so wie ich ihn verstanden habe müsste es so aussehen:</p>
<pre><code class="language-cpp">#include &lt;cmath&gt;
#include &lt;iostream&gt;
#include &lt;complex&gt;

#define PI 3.14159265359

using namespace std;

int main(int argc, char **argv)
{
    const complex&lt;double&gt; I(0,1);
    complex&lt;double&gt; Zs;
    double f,R,L,C,omega;

    f = 1000;/*Hz*/
    R = 1000;/*Ω */
    L = 150; /*H */
    C = 2e-7;/*F */
    omega = 2*PI*f;
    /*Hier entscheidende Zeile*/
    Zs = R +  I*(1.0/(omega*C));

    cout &lt;&lt; Zs &lt;&lt; endl;
    return 0;
}
</code></pre>
<p>So kann es aber nicht funktionieren.<br />
Wie hast du es gemeint, könntest du ein Beispiel posten ?</p>
<p>/*Edit*/<br />
Ich habe in meinem Programm ausversehen anstelle von R eine 0(int) gehabt, das war das Problemm.<br />
Also danke Jester, deine Lösung war das was ich suchte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135306</guid><dc:creator><![CDATA[Marcin]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:44:32 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 15:37:18 GMT]]></title><description><![CDATA[<p>Marcin schrieb:</p>
<blockquote>
<p>So kann es aber nicht funktionieren.</p>
</blockquote>
<p>Dein Programm kompiliert und läuft. Was ist dein Problem damit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135307</guid><dc:creator><![CDATA[.filmor]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:37:18 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 16:21:32 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/5579">@Marcin</a><br />
R + I rechnen mach irgendwie keinen Sinn. Was du vermutlich willst ist C + C rechnen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135343</guid><dc:creator><![CDATA[kmdf]]></dc:creator><pubDate>Mon, 11 Sep 2006 16:21:32 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 16:46:44 GMT]]></title><description><![CDATA[<p>Marcin schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/1387">@Braunstein</a><br />
Wie du sicher weiss kann man in C folgendes schreiben:</p>
<pre><code class="language-cpp">complex double Zs;
Zs = R + I*(1.0/(omega*C));
</code></pre>
</blockquote>
<p>Ehrlich gesagt weiß ich das nicht, und habe eine solche Schreibweise auch noch nicht gesehen. Der Hinweis in meinem Post sollte eigentlich das ausdrücken, was Jester dann geschrieben hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135359</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 11 Sep 2006 16:46:44 GMT</pubDate></item><item><title><![CDATA[Reply to complex Imaginärteil on Mon, 11 Sep 2006 17:06:46 GMT]]></title><description><![CDATA[<p>@kmdf</p>
<blockquote>
<p>R + I rechnen mach irgendwie keinen Sinn.</p>
</blockquote>
<p>Es ist auch keine Berechnung sondern nur komplexe Zahl in kartesischer Form.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/1387">@Braunstein</a></p>
<blockquote>
<p>und habe eine solche Schreibweise auch noch nicht gesehen</p>
</blockquote>
<p>Jetzt schon, falls dich das interessiert schau die wie komplexe Zahlen in C99 gehandhabt werden.</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9606">@.filmor</a><br />
Ich bin mit C++ nicht so geübt,und dachte dass + operator nur für complex + complex definiert ist.</p>
<p>Ansonsten Danke für die Antworten das Problem ist gelöst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135362</guid><dc:creator><![CDATA[Marcin]]></dc:creator><pubDate>Mon, 11 Sep 2006 17:06:46 GMT</pubDate></item></channel></rss>