| |
|
|
p.specht
| Wieviele Pendel creates Profan in the Interpreter- and in the Compilermodus? ex 40 knickt by me The performance explicit one...
Windowtitle "Multi-Gummipendel"'(CL)CopyLeft 2014-03 by P.woodpecker, Wien
Windowstyle 24:Window 0,0-%maxx,%maxy-40' No however geartete Gewähr!
randomize:var col&=rgb(200+rnd(56),200+rnd(56),200+rnd(56))
var xx&=width(%hwnd):var yy&=height(%hwnd):var xh!=xx&/2:var yh!=yy&/2:var zoom!=2000
var nn&=42' <<< ANZAHL THE PENDEL
var n&=nn&
declare g!,t!,wind!
declare x![n&],y![n&],dx![n&],dy![n&],fk![n&],mx![n&],my![n&]
declare m![n&],fx![n&],fy![n&],ax![n&],ay![n&],vx![n&],vy![n&]
g! =9.80665'm/s²
t! =0.013'Zeitschritt
fk![]=3'zoom*n/m
m![] =4.8'kg
fk![1]=10'zoom*n/m
m![1]=4.8
MCls xx&,yy&
REPEAT
n&=1
mx![n&]=%mousex-xh!-x![n&]*zoom!
my![n&]=yh!-%mousey-y![n&]*zoom!
dx![n&]=mx![n&]:dy![n&]=my![n&]
Fx![n&]=dx![n&]*fk![n&]+Fx![n&+1]*t!:Fy![n&]=dy![n&]*fk![n&]+Fy![n&+1]*t!
ax![n&]=Fx![n&]/m![n&]:ay![n&]=Fy![n&]/m![n&]-g!'Gravitation
wind!=(rnd(90)-rnd(70))/zoom!
vx![n&]=vx![n&]+0.5*ax![n&]*t!+wind!:vy![n&]=vy![n&]+0.5*ay![n&]*t!
vx![n&]=vx![n&]*0.9:vy![n&]=vy![n&]*0.9
x![n&]=x![n&]+vx![n&]*t!:y![n&]=y![n&]+vy![n&]*t!
whileloop nn&-1,2,-1:n&=&Loop
mx![n&]=(x![n&-1]-x![n&])*zoom!
my![n&]=(y![n&-1]-y![n&])*zoom!
dx![n&]=mx![n&]-x![n&]:dy![n&]=my![n&]-y![n&]
Fx![n&]=dx![n&]*fk![n&]+Fx![n&+1]*t! : Fy![n&]=dy![n&]*fk![n&]+Fy![n&+1]*t!
ax![n&]=Fx![n&]/m![n&]:ay![n&]=Fy![n&]/m![n&] - g!'Gravitation
vx![n&]=vx![n&]+.5*ax![n&]*t!:vy![n&]=vy![n&]+.5*ay![n&]*t!
vx![n&]=vx![n&]*0.7:vy![n&]=vy![n&]*0.7
x![n&]=x![n&]+vx![n&]*t!: y![n&]=y![n&]+vy![n&]*t!
endwhile
StartPaint -1:ClS col&
usepen 0,1,0:line xh!,0 - xh!,yy& : line 0,yh! - xx&,yh!
usepen 0,3,0:line %mousex,%mousey - xh!+x![n&]*zoom!,yh!-y![n&]*zoom!
usepen 0,20,0:line %mousex,%mousey - %mousex-1,%mousey
whileloop 3,nn&-1:n&=&Loop
usepen 0,3,0:line xh!+x![n&-1]*zoom!,(yh!-y![n&-1]*zoom!) - xh!+x![n&]*zoom!,yh!-y![n&]*zoom!
Endwhile
whileloop 2,nn&-1:n&=&Loop
usepen 0,35+sqrt(10*m![n&]),n&*$5F000:line xh!+x![n&]*zoom!,(yh!-y![n&]*zoom!-1) - xh!+x![n&]*zoom!,yh!-y![n&]*zoom!
Endwhile
EndPaint
MCopyBMP 0,0-xx&,yy& > 0,0;0
waitinput 4
UNTIL %key=27
end
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/11/21 ▲ |
|
|
|