Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
35
Task/Animate-a-pendulum/ERRE/animate-a-pendulum.erre
Normal file
35
Task/Animate-a-pendulum/ERRE/animate-a-pendulum.erre
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
PROGRAM PENDULUM
|
||||
|
||||
!
|
||||
! for rosettacode.org
|
||||
!
|
||||
|
||||
!$KEY
|
||||
|
||||
!$INCLUDE="PC.LIB"
|
||||
|
||||
PROCEDURE PENDULUM(A,L)
|
||||
PIVOTX=320
|
||||
PIVOTY=0
|
||||
BOBX=PIVOTX+L*500*SIN(a)
|
||||
BOBY=PIVOTY+L*500*COS(a)
|
||||
LINE(PIVOTX,PIVOTY,BOBX,BOBY,6,FALSE)
|
||||
CIRCLE(BOBX+24*SIN(A),BOBY+24*COS(A),27,11)
|
||||
PAUSE(0.01)
|
||||
LINE(PIVOTX,PIVOTY,BOBX,BOBY,0,FALSE)
|
||||
CIRCLE(BOBX+24*SIN(A),BOBY+24*COS(A),27,0)
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
SCREEN(9)
|
||||
THETA=40*p/180 ! initial displacement
|
||||
G=9.81 ! acceleration due to gravity
|
||||
L=0.5 ! length of pendulum in metres
|
||||
LINE(0,0,639,0,5,FALSE)
|
||||
LOOP
|
||||
PENDULUM(THETA,L)
|
||||
ACCEL=-G*SIN(THETA)/L/100
|
||||
SPEED=SPEED+ACCEL/100
|
||||
THETA=THETA+SPEED
|
||||
END LOOP
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue