Skip to content

Commit

Permalink
added basic for 5-2
Browse files Browse the repository at this point in the history
  • Loading branch information
torimcd committed Aug 8, 2020
1 parent 7099f4a commit 116bb8a
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions GW-BASIC/CORIOLIS.BAS
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,65 @@
25701 PSET(L(2),M(2)),1: PSET (L(3),M(3)),1
25725 NEXT
25750 RETURN
26000 'Exercise 5-2: 3 surf rev PLANE PERIODS*
26010 'Indices (1) simple harmonic motion
26011 'Indices (2) paraboloid
26012 'Indices (3) concave up hemisphere
26020 SCREEN 1: COLOR 0,2: KEY OFF: CLS
26030 DT=0.01: G=1: D=1
26040 K=1: K2=K^2: C=K2/2: A=K2/G
26050 MU=0
26060 GOSUB 26320: GOSUB 26370
26070 FOR I=1 TO 3: R(I)=.5: NEXT
26080 FOR I=1 TO 3: RD(I)=0: NEXT
26100 RDD(1)=MU^2/(R(1)^3)-K^2*R(1)
26105 AAA=(1+(2*C*R(2))^2)
26106 BBB=-2*G*C*R(2)-R(2)*(2*C*RD(2))^2
26107 CCC=MU^2/(R(2)^3)
26110 RDD(2)=(BBB+CCC)/AAA
26120 AA=-G*R(3)/SQR((A^2-R(3)^2))
26121 BB=MU^2/(R(3)^3)
26130 CC=-RD(3)^2*(A^2*R(3)/((A^2-R(3)^2)^2))
26140 DD=1+R(3)^2/(A^2-R(3)^2)
26150 RDD(3)=(AA+BB+CC)/DD
26220 FOR I=1 TO 3: RD(I)=RDD(I)*DT+RD(I)
26221 R(I)=RD(I)*DT+R(I): NEXT
26230 FOR I=1 TO 3: PD(I)=MU/(R(I)^2)
26231 P(I)=PD(I)*DT+P(I): NEXT
26240 FOR I=1 TO 3: X(I)=R(I)*COS(P(I))
26241 Y(I)=R(I)*SIN(P(I)): NEXT
26250 FOR I=1 TO 3
26251 PSET (50*X(I)+70+80*(I-1),60-50*Y(I)),I
26252 NEXT
26260 FOR I=1 TO 3: LOCATE 15+I,5
26261 IF FLAG(I)=1 THEN GOTO 26280
26265 ZZZ=RD(I)*RDL(I)
26270 IF ZZZ<0 THEN GOTO 26271 ELSE GOTO 26280
26271 FLAG(I)=1
26272 PRINT USING "t(#)=##.##"; I,2*T
26280 RDL(I)=RD(I)
26290 NEXT
26300 T=T+DT
26310 GOTO 26100
26320 FOR I=0 TO 2
26321 CIRCLE(70+80*I,60),30,1: NEXT
26330 LOCATE 23,5
26331 PRINT " plane parabol sphere";
26340 LOCATE 1,5
26341 PRINT " Three surfaces of revolution";
26350 LOCATE 2,5
26351 PRiNT "PERIODS FOR PLANE OSCILLATIONS";
26360 RETURN
26370 FOR I=-0.7 TO 0.7 STEP 0.02: 'side view
26380 L(1)=50*I+70+80*0: M(1)=170
26390 L(2)=50*I+70+80*1: M(2)=170-50*C*I^2
26400 IF (A^2-I^2)=<0 THEN GOTO 26420
26410 L(3)=50*I+70+80*2
26411 M(3)=170-50*(A-SQR(A^2-I^2))
26420 PSET(L(1),M(1)),1: PSET(L(2),M(2)),1
26421 PSET(L(3),M(3)),1
26430 NEXT
26440 RETURN
30000 'Exer 7-1; particle on spheroid earth **
30010 SCREEN 1: COLOR 0,2: KEY OFF: CLS
30020 'absolute 1 and 2, relative 3 and 4
Expand Down

0 comments on commit 116bb8a

Please sign in to comment.