Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
24
Task/Animate-a-pendulum/AmigaBASIC/animate-a-pendulum.basic
Normal file
24
Task/Animate-a-pendulum/AmigaBASIC/animate-a-pendulum.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
SCREEN 1,320,256,1,1
|
||||
WINDOW 2,"Pendulum (press any key to quit)",,0,1
|
||||
PI = 3.1415926535#
|
||||
theta = PI/2
|
||||
g = 9.81
|
||||
l = 1
|
||||
speed = 0
|
||||
px = 150
|
||||
py = 10
|
||||
bx = 0
|
||||
by = 0
|
||||
|
||||
WHILE INKEY$=""
|
||||
LINE (bx-5,by-5)-(bx+5,by+5),0,bf
|
||||
LINE (px,py)-(bx,by),0
|
||||
bx=px+l*140*SIN(theta)
|
||||
by=py-l*140*COS(theta)
|
||||
CIRCLE (bx,by),5,1,,,1
|
||||
LINE (px,py)-(bx,by)
|
||||
accel=g*SIN(theta)/l/100
|
||||
speed=speed+accel/100
|
||||
theta=theta+speed
|
||||
WEND
|
||||
SCREEN CLOSE 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue