Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
Module Pendulum {
|
||||
back()
|
||||
degree=180/pi
|
||||
THETA=Pi/2
|
||||
SPEED=0
|
||||
G=9.81
|
||||
L=0.5
|
||||
Profiler
|
||||
lasttimecount=0
|
||||
cc=40 ' 40 ms every draw
|
||||
accold=0
|
||||
Every cc {
|
||||
ACCEL=G*SIN(THETA*degree)/L/50
|
||||
SPEED+=ACCEL/cc
|
||||
THETA+=SPEED
|
||||
Pendulum(THETA)
|
||||
if KeyPress(32) Then Exit
|
||||
}
|
||||
|
||||
Sub back()
|
||||
If not IsWine then Smooth On
|
||||
Cls 7,0
|
||||
Pen 0
|
||||
Move 0, scale.y/4
|
||||
Draw scale.x,0
|
||||
Step -scale.x/2
|
||||
circle fill #AAAAAA, scale.x/50
|
||||
Hold ' hold this as background
|
||||
End Sub
|
||||
|
||||
Sub Pendulum(x)
|
||||
x+=pi/2
|
||||
Release ' place stored background to screen
|
||||
Width scale.x/2000 {
|
||||
Draw Angle x, scale.y/2.5
|
||||
Width 1 {
|
||||
Circle Fill 14, scale.x/25
|
||||
}
|
||||
Step Angle x, -scale.y/2.5
|
||||
}
|
||||
Print @(1,1), lasttimecount
|
||||
if sgn(accold)<>sgn(ACCEL) then lasttimecount=timecount: Profiler
|
||||
accold=ACCEL
|
||||
Refresh 1000
|
||||
End Sub
|
||||
}
|
||||
Pendulum
|
||||
Loading…
Add table
Add a link
Reference in a new issue