Thread View: de.comp.lang.java
5 messages
5 total messages
Started by Martin Horoba
Sun, 13 Aug 2000 00:00
Beispiel für Funktionsdarstellung
Author: Martin Horoba
Date: Sun, 13 Aug 2000 00:00
Date: Sun, 13 Aug 2000 00:00
7 lines
915 bytes
915 bytes
Hi, ich suche einen Java-Beispiel-Source/Quelle f�r Beispiele zur korrekten Darstellung von Funktionen; beispielsweise cos(x) usw. Danke f�r Tips martin
Re: Beispiel f�r Funktionsdarstellung
Author: Sven Gohlke
Date: Sun, 13 Aug 2000 00:00
Date: Sun, 13 Aug 2000 00:00
17 lines
1337 bytes
1337 bytes
Am Son, 13 Aug 2000 hat Martin Horoba geschrieben:
>ich suche einen Java-Beispiel-Source/Quelle f�r Beispiele zur korrekten
>Darstellung von Funktionen; beispielsweise cos(x) usw.
?;-)
Graphische Darstellung?
Sven
--
"Sven Gohlke" <sven@clio.in-berlin.de>
Sven Gohlke
Kladower Damm 342a
14086 Berlin
Fon: [+49] (30) 368 03 694
Re: Beispiel f�r Funktionsdarstellung
Author: Niko Schwarz
Date: Mon, 14 Aug 2000 00:00
Date: Mon, 14 Aug 2000 00:00
16 lines
1286 bytes
1286 bytes
> Graphische Darstellung?
naja, ich denk, er will einfach die graphen gezeichnet haben. dat iss doch
aber einfacher als pfannkuchen essen!
Point old=new Point(-200,0)
Point origin=new Point(); // kooridinatenursprung
for(int i = -200; i<200;i++) {
Point newPoint=new Point();
Point newPoint=new Point();
newPoint.x= origin.x + i;
newPoint.y=origin.y - Math.round( Math.cos(i) );
g.drawLine( old.x,old.y, newPoint.x, newPoint.y );
old=newPoint;
}
Re: Beispiel für Funktionsdarstellung
Author: Martin Horoba
Date: Mon, 14 Aug 2000 00:00
Date: Mon, 14 Aug 2000 00:00
14 lines
1190 bytes
1190 bytes
hi,
bei mir war eine parabel noch korrekt in der darstellung, eine
sinus-kurve sah jedoch aus wie ein netz voller Keine ahnung...]
ich habs nun etwa so:
for (x=-wcx; x<wcx; x++) // Funktionsdarstellung
{
x2=x+1;
y =( x*x )/ Zoom;
y2 =( x2+x2 )/ Zoom;
g.drawLine(wcx+x, wcy-y, wcx+x2, wcy-y2);
}
Re: Beispiel f�r Funktionsdarstellung
Author: Niko Schwarz
Date: Mon, 14 Aug 2000 00:00
Date: Mon, 14 Aug 2000 00:00
2 lines
976 bytes
976 bytes
Jau Ingo, das hat mich auch mal nen halben Nachmittag gekostet... ein Kreis hat nunmal 2 PI und nicht 360�...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads