Elastic Pendulum/Elastisk Pendel

Game Introduction

This elastic pendulum program got featured on the Scratch home-page August 1, 2013. Thanks! You can see lists of this program at http://blob8108.github.io/scratchblocks2/generator/#project=11504974 (don't work 4 Nov 2019). This program is based on a program for Microsoft GWBASIC (for PC) I wrote in Spring 1987 as a solution to an assignment in Physics 101 at Lund University: ELASTISK.BAS: 10 REM ---- E L A S T I S K P E N D E L ---- 20 REM --Konstanter-- 30 G=9.810001:REM m/(s*s) 40 L=.4:REM m 50 M=.12:REM kg 60 K=10.1:REM N/m 70 DT=.002:REM s 80 REM --Initial tillstånd-- 90 T=0 100 VX=0 110 VY=0 120 INPUT "X,Y ";X,Y 130 R=SQR(X*X+Y*Y) 140 REM -- Grafinit -- 150 XTEMP=X:YTEMP=Y 151 CLS:SCREEN 2:GOSUB 400:REM rita koordaxlar 152 X=XTEMP:Y=YTEMP 160 GOSUB 320: REM OMVANDLA 170 PSET(XPL,YPL) 180 REM --Stegning-- 190 GOSUB 320:REM OMVANDLA 200 LINE -(XPL,YPL) 210 FX=-K*(R-L)*X/R 220 FY=-K*(R-L)*Y/R-M*G 230 AX=FX/M 240 AY=FY/M 250 VX=VX+AX*DT 260 VY=VY+AY*DT 270 X=X+VX*DT 280 Y=Y+VY*DT 285 R=SQR(X*X+Y*Y) 290 T=T+DT 300 GOTO 180:REM stegning 310 STOP 320 REM --OMVANDLA-- 330 XPL=250*X+300 340 YPL=-160*Y+20 350 RETURN 400 REM --Koordaxlar-- 410 X=-1:Y=0 420 GOSUB 320:REM OMVANDLA 430 PSET(XPL,YPL) 440 X=1:Y=0 450 GOSUB 320 460 LINE -(XPL,YPL) 470 X=0:Y=.1 480 GOSUB 320 490 PSET(XPL,YPL) 500 X=0:Y=-1 510 GOSUB 320 520 LINE -(XPL,YPL) 530 RETURN

How To Play

[en] ([sv] below/nedan) Click a green flag to start. You can toggle turbo mode in Scratch by shift-clicking the flag. Drag and drop the weight where you want it to start. You can also click on the background to move and start. If the weight doesn't move then click the weight to start the simulation. The spring isn't visible but the weight and hook turns as if it existed. [sv] Klicka på en grön flagga för att starta. Om du skift-klickar på flaggan så startar Scratch i turboläge. Drag och släpp tyngden där du vill att den skall starta. Du kan också klicka på bakgrunden för att flytta och starta. Om tyngden står stilla så klicka på tyngden för att starta simuleringen. Fjädern syns inte men tyngden och kroken vrider sig som om den fanns.

Author

mobluse

Category

Game Information

Game Popularity

7.3k views

Collection Count

121 favorites