<?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[Problem mit sinus und cosinus]]></title><description><![CDATA[<p>hey leute</p>
<p>ich will cosinus und sinus programmieren ohne c.math zu includieren...<br />
hat da jemand eine funktionierende lösung bzw ein guter link??</p>
<p>wär super!!<br />
vielen dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/243438/problem-mit-sinus-und-cosinus</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 03:14:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/243438.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Jun 2009 17:20:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 17:20:27 GMT]]></title><description><![CDATA[<p>hey leute</p>
<p>ich will cosinus und sinus programmieren ohne c.math zu includieren...<br />
hat da jemand eine funktionierende lösung bzw ein guter link??</p>
<p>wär super!!<br />
vielen dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727752</guid><dc:creator><![CDATA[Fabe1987]]></dc:creator><pubDate>Tue, 16 Jun 2009 17:20:27 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 17:22:48 GMT]]></title><description><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Sinus_und_Kosinus#Definition_als_Taylorreihe" rel="nofollow">http://de.wikipedia.org/wiki/Sinus_und_Kosinus#Definition_als_Taylorreihe</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727753</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727753</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 16 Jun 2009 17:22:48 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 18:19:12 GMT]]></title><description><![CDATA[<p>hey<br />
vielen dank...hat mich etwas weitergebracht...<br />
bin aber leider noch blutiger anfänger =-)<br />
weisst du wo ich eine fertige und funktionierende lösung herbekomme?<br />
viele grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727789</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727789</guid><dc:creator><![CDATA[Fabe1987]]></dc:creator><pubDate>Tue, 16 Jun 2009 18:19:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 18:21:37 GMT]]></title><description><![CDATA[<p>Du bekommst die Lösung in <code>&lt;cmath&gt;</code> . Wieso willst du den Header nicht verwenden?<br />
Ansonsten findest du vielleicht etwas auf <a href="http://www.sf.net" rel="nofollow">www.sf.net</a>.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727792</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 16 Jun 2009 18:21:37 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 18:35:12 GMT]]></title><description><![CDATA[<p>siehe dravere ^^</p>
<p>edit: oh - ich seh gerad, dass das ja ganze 10 minuten her war - hab wohl vergessen zu refreshen -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727803</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Tue, 16 Jun 2009 18:35:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 18:40:33 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>der professor meinte wir sollen es mit schleifen und unterprogramme ...also mit der taylor- reihe versuchen...für anfänger halt =-)</p>
<p>hab es nun mit der taylorreihe probiert...das programm geht leider noch nicht so wie ich will sieht hier jemand meine fehler??---wäre klasse</p>
<p>#include &lt;iostream&gt;<br />
using namespace std;<br />
unsigned long fak(int wert);<br />
double potenz(double basis,int hochzahl);<br />
double cos(double x);</p>
<p>void main()<br />
{<br />
double grad;<br />
cout&lt;&lt;&quot;Gib einen Winkel in Grad ein: &quot;;<br />
cin&gt;&gt;grad;<br />
cout&lt;&lt;&quot;cos(&quot;&lt;&lt;grad&lt;&lt; &quot;°) = &quot;&lt;&lt;cos(grad)&lt;&lt;endl;</p>
<p>char dummy; cin&gt;&gt;dummy;<br />
};</p>
<p>unsigned long fak(int wert)<br />
{<br />
unsigned long produkt=1;<br />
for (int i=1;i&lt;=wert;i++)<br />
produkt=produkt*i;<br />
return produkt;<br />
}</p>
<p>double potenz(double basis,int hochzahl)<br />
{<br />
double produkt=1;<br />
for (int i=1;i&lt;=hochzahl;i++)<br />
produkt=produkt*basis;<br />
return produkt;<br />
}</p>
<p>double cos(double x)<br />
{<br />
while (x&lt;-180||x&gt;-180)<br />
{<br />
if (x&lt;-180) x=x+360;<br />
//else x=x-360;<br />
if (x&gt;180) x=x-360;<br />
}</p>
<p>const double PI=3.141593;<br />
x=x*PI/180;<br />
double summe=0;<br />
int n=0;<br />
double ntesGlied=1;</p>
<p>while ((ntesGlied&gt;0.005) || (ntesGlied&lt;-0.005))<br />
{<br />
ntesGlied=(potenz(-1,n) / fak(2*n) * potenz(x,2*n) );<br />
summe=summe+ntesGlied;<br />
n++;<br />
}</p>
<p>return summe;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727809</guid><dc:creator><![CDATA[Fabe1987]]></dc:creator><pubDate>Tue, 16 Jun 2009 18:40:33 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 19:01:03 GMT]]></title><description><![CDATA[<p>Fabe1987 schrieb:</p>
<blockquote>
<p>sieht hier jemand meine fehler??</p>
</blockquote>
<p>Nein, schon gar nicht bei unformatiertem Code. Verwende [cpp]-Tags.</p>
<p>Aber versuche doch, dir die Reihenentwicklung auf einem Blatt Papier zu überlegen. Dann setzt du Schritt für Schritt in dein Programm um und schaust jeweils, ob die Ergebnisse übereinstimmen. So kommst du schnell auf den Fehler.</p>
<p>Und so lernst du auch Programmieren. Debuggen ist nämlich ein nicht unwesentlicher Teil davon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727839</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727839</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 16 Jun 2009 19:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit sinus und cosinus on Tue, 16 Jun 2009 19:08:02 GMT]]></title><description><![CDATA[<p>das hier war (bis auf kleine fehler) richtig:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt; 
using namespace std; 

unsigned long fak(int wert);
double potenz(double basis, int exponent); //int hochzahl); 
double cos(double x);

void halte_konsole_offen();

//void main()
int main()
{ 
  double grad; 
  cout&lt;&lt;&quot;Gib einen Winkel in Grad ein: &quot;; 
  cin&gt;&gt;grad; 
  cout&lt;&lt;&quot;cos(&quot;&lt;&lt;grad&lt;&lt; &quot;°) = &quot;&lt;&lt;cos(grad)&lt;&lt;endl; 

  halte_konsole_offen();
}; 

void halte_konsole_offe()
{
  char dummy;
  cin&gt;&gt;dummy; 
}

unsigned long fak(int wert) 
{ 
  unsigned long produkt=1; 

  for (int i=1; i&lt;=wert; i++) 
    //produkt=produkt*i;
    produkt *= i;
  return produkt; 
} 

double potenz(double basis,int exponent) 
{ 
  double produkt=1;
  for (int i=1; i&lt;=exponent; i++) 
//    produkt=produkt*basis; 
    produkt *= basis;
  return produkt; 
}
</code></pre>
<p>Bin ich jetzt gerade zu faul, nachzugucken, wie das richtig geht oder ob es vll so gar schon (fast) richtig ist ^^</p>
<pre><code class="language-cpp">double cos(double x) 
{ 
  while (x&lt;-180||x&gt;-180) 
  { 
    if (x&lt;-180) x=x+360; 
    //else x=x-360; 
    if (x&gt;180) x=x-360; 
  } 

  const double PI=3.141593; 
  x=x*PI/180; 
  double summe=0; 
  int n=0; 
  double ntesGlied=1; 

  while ((ntesGlied&gt;0.005) || (ntesGlied&lt;-0.005)) 
  { 
    ntesGlied=(potenz(-1,n) / fak(2*n) * potenz(x,2*n) ); 
    summe=summe+ntesGlied; 
    n++; 
  } 

  return summe; 
}
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1727843</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1727843</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Tue, 16 Jun 2009 19:08:02 GMT</pubDate></item></channel></rss>