| |
|
|
p.specht
| one think itself one weight at a string, The through one vent in a senkrechten disk to a something schwereren Gegengewicht lead. something hochtrabend declared: The entstehende Figur is of Startort, the Anfangsgeschwindigkeit (in x- and y-direction) as well as from the Reibung on the disk tributary. to that terminate something longer The ESC pressing!
Window Title "Gravi-Spirograph"'(CL) CopyLeft 2014-03 by P.woodpecker, Wien
Windowstyle 24:Font 2:Randomize:Window 0,0-%maxx,%maxy-40
var xx&=width(%hwnd):var yy&=height(%hwnd):var xh&=xx&\2:var yh&=yy&*0.2'Nullpunktshöhe
set("decimals",15):set("numwidth",30):var g2r!=Pi()/180:var ende&=0
proc point :parameters x!,y!
usepen 0,1,0:line xh&,0 - xh&,yy&:line 0,yh&-xx&,yh&
usepen 0,24,rgb(100+rnd(156),100+rnd(156),100+0*rnd(156))
line xh&+x!,(yh&-y!) - xh&+x!+1,yh&-y!-1
endproc
declare x!,y!,d!,a!,ax!,ay!,vx!,vy!,t!,g!
g!=9.80665' Erdbeschleunigung in -y direction
t!=0.1' = 1/FPS Simulierter Zeitschritt, 1/FPS = "Echtzeit"
'x!=200:y!=0:vy!=10:vx!=0 'Startpunkt and Initialgeschwindigkeit y=Nach obeb
'x!=200:y!=-100:vy!=8
x!=500:y!=-100:vy!=rnd(12)
repeat
d!=sqrt(sqr(x!)+sqr(y!))
if d!>1
a!=d!*0.0001' Zentripetalbeschleunigung, here of stood off linear tributary
ax!=-x!/d!
ay!=-g!/17-y!/d!
vx!=vx!+ax!/2*t!
vx!=vx!*(1-0.002*t!)' Dämpfung the x-Komponente (2%/sek)
vy!=vy!+ay!/2*t!
vy!=vy!*(1-0.002*t!)'Dämpfung the y-Komponente
x!=x!+vx!*t!
y!=y!+vy!*t!
point x!,y!
endif
if rnd()<0.01:waitinput 5:case %key=27:ende&=1:endif
until ende&
end
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/11/21 ▲ |
|
|
|