Autor Beitrag
Millo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Sa 05.04.03 20:06 
Moin Moin,

Ich glaub ich werd noch verrückt. Ich schaffe es nicht eine parabel dazustellen.
Ich hab x und y werte vorgegeben aber ich weiß net so genau wie ich die jetzt in das Canvas objekt übertragen soll.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 21:23 
was ist denn eine parabel ? kenne ich ja garnicht.....
Sonst könnte ich dir helfen :D

_________________
MFG
Michael Springwald, "kann kein englisch...."
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 21:45 
@mimi

parabeln sind meißt so quadratische funktionen... :wink: (ich hasse geometrie)

www.google.de/search...n+zeichnen&meta=google

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 21:52 
du willst also so ein Quadart erstellen oder wie ?
das ist einfach....

(Wie musst du selbst herrausfinden;))

_________________
MFG
Michael Springwald, "kann kein englisch...."
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 22:04 
nein *schrei* quadratische funktionen.

das hier zum beispiel ist ne parabel:
www.apollon.uio.no/2...pictures/parabel.gif

fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 22:08 
hups;) falsch verstanden......

_________________
MFG
Michael Springwald, "kann kein englisch...."
Segelflieger
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 124

WinXP Pro
D7 Prof
BeitragVerfasst: Sa 05.04.03 23:44 
Das geht am besten mit Canvas.MoveTo(x,y) und Canvas.LineTo(x,y).
MoveTo bewegt den Pen deiner Canvas an eine bestimmte Stelle und LineTo zeichnet eine Linie von der aktuellen Position zu einer bestimmten Stelle.
Du nimmst also am besten, wenn du den ersten Punkt deiner Parabel zeichnest, MoveTo(x,y) und für jeden weiteren Punkt LineTo(x,y) das machst du am besten in einer Schleife, die z.B For x := -10 to 10 läuft.
Aber denkt daran, das der Punkt (0|0) bei TCanvas in der linken oberen Ecke der Zeichenfläche liegt. Außerdem wirst du deine Parabel noch etwas vergrößern müssen, Bsp:
ausblenden Quelltext
1:
 LineTo(trunc(x*10), trunc(y*10));					

Irgendwas verstanden? :roll: Frag einfach!

_________________
Früher hatten die Menschen Angst vor der Zukunft. Heute muss die Zukunft Angst vor den Menschen haben.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 23:47 
Nur gut das ich die Frage nicht gestellt habe(ich habe nichts verstanden, muss ich ja auch nicht).... Ein Beispiel währe nicht schlecht.....
(Ein Ausfüreliches;))

_________________
MFG
Michael Springwald, "kann kein englisch...."
ripper8472
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 114

Win2k (und wenn ich nen Zweitrechner haette, auch eine Linux Distri)

BeitragVerfasst: Mi 09.04.03 00:43 
wenn du mit "parabel" ne fest implementierte kurve meinst, dann ist das einfach:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var x,y:double;

x:=-3;
while (x<3) do begin
x:=x+0.1;
//hier die quad gleichg.
y:=pow(x,2); // ~ x^2
image1.canvas.lineto(((x+3)/6)*image1.width,image1.height-(y/10)*image1.height);
end;


das dürfte ne kurve von -3 bis +3 zeichnen im wertebereich 0-10
ist dirty code, aber da haste immerhin schon was

Moderiert von user profile iconUGrohne: Code-Tags hinzugefügt

_________________
char l[]="\xd6N\x96\xa6\xe6\xce.\xa6\xe4\xce\x04N\x86\xae\xce\xfc",I,*i=l-1;for(;I=3,*
i++;){while(*i=*i&~(1<<I|1<<7-I)|(*i&1<<I)<<7-2*I|(*i&1<<7-I)>>7-2*I,I--);}puts(l);