Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0025/circle.bas
There are 2 other files named circle.bas in the archive. Click here to see a list.
00100	PRINT
00105	PRINT "D   I   V   I   S   I   O   N   ";
00110	PRINT "   O   F      C   I   R   C   L   E"
00115	PRINT
00120	PRINT
00125	PRINT
00130	LET L=0
00135	READ N,R
00140	LET L=L+1
00145	IF N=9E19 THEN 480
00150	PRINT
00155	PRINT "   CASE NUMBER:";L;"   NUMBER OF PARTS:";N;"   RADIUS:";R
00160	PRINT
00165	PRINT "       .........ANGLE..........";
00170	PRINT "              .....CO-ORDINATES....."
00175	PRINT "INDEX  DECIMAL  DEG   MIN   SEC";
00180	PRINT "              HORIZ             VERT"
00185	PRINT
00190	LET Q=0
00195	LET S1 = 1296000/N
00200	LET D = INT(S1/3600)
00205	LET M = INT((S1/3600-D)*60)
00210	LET S = (((S1/3600-D)*60)-M)*60
00215	LET A = 0
00220	LET I = 1
00225	LET B = 0
00230	LET C = 0
00235	LET A = A+D
00240	LET B = B+M
00245	LET C = C+S
00250	IF A > 360 THEN 385
00255	IF ABS(60-C)<.01 THEN 335
00260	IF C>60 THEN 345
00265	IF B >= 60 THEN 365
00270	LET Q=Q+360/N
00275	LET Z=Q*0.01745329
00280	LET X=R*COS(Z)
00285	LET Y=R*SIN(Z)
00290	IF ABS(X)>(5E-5)*R THEN 300
00295	LET X=0
00300	IF ABS(Y)>(5E-5)*R THEN 310
00305	LET Y=0
00310	IF A<360 THEN 320
00315	LET C=0
00320	PRINT I;TAB(7);Q;TAB(16);A;TAB(22);B;TAB(28);.1*INT(10*C+.5);
00321	PRINT TAB(45);X;TAB(61);Y
00325	LET I = I+1
00330	GOTO 235
00335	LET C=0
00340	GOTO 350
00345	LET C=C-60
00350	LET B = B+1
00355	IF B >= 60 THEN 365
00360	GOTO 270
00365	LET B = B-60
00370	LET A = A+1
00375	IF A > 360 THEN 385
00380	GOTO 270
00385	PRINT
00390	PRINT
00395	PRINT
00400	GOTO 135
00405	PRINT
00410	PRINT
00415	PRINT "THIS PROGRAM WILL DIVIDE CIRCLES INTO ANY NUMBER OF"
00420	PRINT "EQUAL PARTS, GIVING THE ANGLES IN DECIMAL DEGREES AND"
00425	PRINT "DEGREES, MINUTES, AND SECONDS, AND ALSO THE HORIZONTAL"
00430	PRINT "AND VERTICAL DISTANCES FROM THE CENTER TO THE POINT ON"
00435	PRINT "THE CIRCUMFERENCE.   TO USE, ENTER DATA AS FOLLOWS:"
00440	PRINT
00445	PRINT "   10  DATA  N, R,..........."
00450	PRINT
00455	PRINT "WHERE N IS THE NUMBER OF PARTS AND R IS THE RADIUS OF"
00460	PRINT "THE CIRCLE TO BE SUBDIVIDED INTO N PARTS.  AS MANY CASES"
00465	PRINT "AS DESIRED MAY BE ENTERED IN THE SAME WAY BY CONTINUING"
00470	PRINT "THE DATA LIST.   THEN TYPE 'RUN'."
00475	DATA 9E19,2E22
00480	END