Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Animate-a-pendulum/FreeBASIC/animate-a-pendulum.basic
Normal file
22
Task/Animate-a-pendulum/FreeBASIC/animate-a-pendulum.basic
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Const PI = 3.141592920
|
||||
Dim As Double theta, g, l, accel, speed, px, py, bx, by
|
||||
theta = PI/2
|
||||
g = 9.81
|
||||
l = 1
|
||||
speed = 0
|
||||
px = 320
|
||||
py = 10
|
||||
Screen 17 '640x400 graphic
|
||||
Do
|
||||
bx=px+l*300*Sin(theta)
|
||||
by=py-l*300*Cos(theta)
|
||||
Cls
|
||||
Line (px,py)-(bx,by)
|
||||
Circle (bx,by),5,,,,,F
|
||||
accel=g*Sin(theta)/l/100
|
||||
speed=speed+accel/100
|
||||
theta=theta+speed
|
||||
Draw String (0,370), "Pendulum"
|
||||
Draw String (0,385), "Press any key to quit"
|
||||
Sleep 10
|
||||
Loop Until Inkey()<>""
|
||||
Loading…
Add table
Add a link
Reference in a new issue