<?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 nem programm zum plotten der sin&#x2F;cos funktion]]></title><description><![CDATA[<p>hi hab hier mal ein prob!<br />
ich weiß einfach nit wie ich anfangen soll mit dem prog.</p>
<p>wie kann ich ein koordinatenkreuz erstellen mit ner doppelten char funktion was die maßen 80*25 hat und wie beschrifte ich das dingen????</p>
<p>wäre nett wenn mir jemand helfen könnte denn den rest den hab ich wohl mir fehlt nur dsa koordinatenkreuz!!!</p>
<p>diese beiden datein habe ich schon aber ich weiß nicht da fehtl noch was und ich bekommen es nicht hin:</p>
<p>#ifndef TEXTPLOTT_H_<br />
#define TEXTPLOTT_H_</p>
<p>#define ROWS 25<br />
#define COLS 80<br />
#include &lt;stdio.h&gt;</p>
<p>char feld[ROWS][COLS];<br />
int xintervall;<br />
int yintervall;<br />
int xachse;</p>
<p>/** initialize the plotter */<br />
void clearPlotter(){<br />
int r=0,c=0;<br />
for(r=0; r&lt;=ROWS; r++){<br />
for(c=0; c&lt;=COLS; c++){<br />
feld [r][c] ='.';<br />
}<br />
}<br />
}</p>
<p>/** print plotter array to stdout */<br />
void showPlotter(){<br />
int r,c;<br />
for (r=0; r&lt;ROWS; r++){<br />
for(c=0; c&lt;COLS+1; c++){<br />
if(c&lt;COLS){<br />
putchar(feld[r][c]);<br />
}<br />
else printf(&quot;\n&quot;);<br />
}<br />
}<br />
}</p>
<p>/** set the plott area coordinates */<br />
void setPlottArea(float x0, float y0, float x1, float y1){<br />
int c,r;<br />
c = x1-x0;<br />
r = y1-y0;<br />
xintervall = COLS/c;<br />
yintervall = ROWS/r;<br />
xachse = x0;<br />
printf(&quot;xintervall=%d, yintervall=%d\n&quot;, xintervall,yintervall);<br />
}</p>
<p>/** plott char at coordinate (y,x) */<br />
void plott(float x, float y, char ch);</p>
<p>/** utility method to draw x,y axes */<br />
void plott_Axes(){<br />
int c,r,ra;<br />
for (c=0;c&lt;COLS;c++){<br />
if(c-xachse==2){<br />
for (ra=0;ra&lt;ROWS;ra++){<br />
feld[r][ra]='|';<br />
}<br />
}<br />
}<br />
for (c=0;c&lt;COLS;c++){<br />
if (c%xintervall){<br />
feld[r][c]='-';<br />
}<br />
else<br />
feld[r][c]='+';<br />
}<br />
}</p>
<p>#endif /*TEXTPLOTT_H_*/</p>
<p>und die:</p>
<p>#include &lt;math.h&gt;<br />
#include &quot;textplott.h&quot;</p>
<p>int main(int argc, char <em>argv[]){<br />
/*float x,y;*/<br />
clearPlotter();<br />
setPlottArea(-5,-1.2,6.3,1.2);<br />
/<em>for(x=0; x &lt; 6; x+=0.01){<br />
y = sin(x);<br />
plott(x,y,'</em>');<br />
y = cos(x);<br />
plott(x,y,'+');<br />
}</em>/<br />
plott_Axes();</p>
<p>showPlotter();</p>
<p>return 1;<br />
}</p>
<p>wäre cool wenn mir jemand helfen könnte! <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/topic/129215/problem-mit-nem-programm-zum-plotten-der-sin-cos-funktion</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 02:23:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129215.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Dec 2005 15:04:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problem mit nem programm zum plotten der sin&#x2F;cos funktion on Sun, 11 Dec 2005 17:48:13 GMT]]></title><description><![CDATA[<p>hi hab hier mal ein prob!<br />
ich weiß einfach nit wie ich anfangen soll mit dem prog.</p>
<p>wie kann ich ein koordinatenkreuz erstellen mit ner doppelten char funktion was die maßen 80*25 hat und wie beschrifte ich das dingen????</p>
<p>wäre nett wenn mir jemand helfen könnte denn den rest den hab ich wohl mir fehlt nur dsa koordinatenkreuz!!!</p>
<p>diese beiden datein habe ich schon aber ich weiß nicht da fehtl noch was und ich bekommen es nicht hin:</p>
<p>#ifndef TEXTPLOTT_H_<br />
#define TEXTPLOTT_H_</p>
<p>#define ROWS 25<br />
#define COLS 80<br />
#include &lt;stdio.h&gt;</p>
<p>char feld[ROWS][COLS];<br />
int xintervall;<br />
int yintervall;<br />
int xachse;</p>
<p>/** initialize the plotter */<br />
void clearPlotter(){<br />
int r=0,c=0;<br />
for(r=0; r&lt;=ROWS; r++){<br />
for(c=0; c&lt;=COLS; c++){<br />
feld [r][c] ='.';<br />
}<br />
}<br />
}</p>
<p>/** print plotter array to stdout */<br />
void showPlotter(){<br />
int r,c;<br />
for (r=0; r&lt;ROWS; r++){<br />
for(c=0; c&lt;COLS+1; c++){<br />
if(c&lt;COLS){<br />
putchar(feld[r][c]);<br />
}<br />
else printf(&quot;\n&quot;);<br />
}<br />
}<br />
}</p>
<p>/** set the plott area coordinates */<br />
void setPlottArea(float x0, float y0, float x1, float y1){<br />
int c,r;<br />
c = x1-x0;<br />
r = y1-y0;<br />
xintervall = COLS/c;<br />
yintervall = ROWS/r;<br />
xachse = x0;<br />
printf(&quot;xintervall=%d, yintervall=%d\n&quot;, xintervall,yintervall);<br />
}</p>
<p>/** plott char at coordinate (y,x) */<br />
void plott(float x, float y, char ch);</p>
<p>/** utility method to draw x,y axes */<br />
void plott_Axes(){<br />
int c,r,ra;<br />
for (c=0;c&lt;COLS;c++){<br />
if(c-xachse==2){<br />
for (ra=0;ra&lt;ROWS;ra++){<br />
feld[r][ra]='|';<br />
}<br />
}<br />
}<br />
for (c=0;c&lt;COLS;c++){<br />
if (c%xintervall){<br />
feld[r][c]='-';<br />
}<br />
else<br />
feld[r][c]='+';<br />
}<br />
}</p>
<p>#endif /*TEXTPLOTT_H_*/</p>
<p>und die:</p>
<p>#include &lt;math.h&gt;<br />
#include &quot;textplott.h&quot;</p>
<p>int main(int argc, char <em>argv[]){<br />
/*float x,y;*/<br />
clearPlotter();<br />
setPlottArea(-5,-1.2,6.3,1.2);<br />
/<em>for(x=0; x &lt; 6; x+=0.01){<br />
y = sin(x);<br />
plott(x,y,'</em>');<br />
y = cos(x);<br />
plott(x,y,'+');<br />
}</em>/<br />
plott_Axes();</p>
<p>showPlotter();</p>
<p>return 1;<br />
}</p>
<p>wäre cool wenn mir jemand helfen könnte! <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/939591</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/939591</guid><dc:creator><![CDATA[tomte]]></dc:creator><pubDate>Sun, 11 Dec 2005 17:48:13 GMT</pubDate></item></channel></rss>