Here is the code for my provisional program. I see no real bug
The fact that my program examines only one quarter of the sphere should not be a problem for the final calculation of proportionality ....
Unless ..... I am too tired to notice!
I DONT SEE ANY BUG
AND YOU ?
|
THE LANGAGE DOWNLOAD IS HERE
FreeBASIC Programming Language
FreeBASIC Programming Language
THE CODE
SCREEN 19,32
DIM AS DOUBLE accpete, accfuge,vol,pi,scale,PROPGRAV
DIM AS INTEGER I, J,K,L,M,N,TOTAL
PI=3.1415926
N=20
N*=10
'L=250
L=N
vol=1/3*Pi*N^3
PRINT "vol/4 = "; 1/3*Pi*N^3
SCALE = N/100
DO
LOCATE 1,40
PRINT "STARS ";TOTAL;" fract STARS/(VOL/4) :" ;TOTAL/VOL
TOTAL=0
accpete=0
accfuge=0
FOR I= -N-1 TO L+1
FOR J= 1 TO 1+int (SQR(N^2-I^2))
FOR K= 1 TO 1+int (SQR(N^2-I^2-J^2))
PSET (300+I/SCALE,400-J/SCALE),255
TOTAL+=1
accpete+=-(L-I)/((L-I)^2+J^2+K^2)^1.5
'locate 20,20
'PRINT ACCPETE
NEXT K
NEXT J
locate 2,2
PRINT ACCPETE
NEXT I
'PRINT TOTAL, VOL, ,accpete
PRINT TOTAL/VOL;
FOR I= L+2 TO N+1
FOR J= 1 TO 1+int (SQR(N^2-I^2))
FOR K= 1 TO 1+int (SQR(N^2-I^2-J^2))
PSET (300+I/SCALE,400-J/SCALE), &hD2E6FF
TOTAL+=1
accfuge+=-(L-I)/((L-I)^2+J^2+K^2)^1.5
'locate 20,30
'PRINT ACCFUGE
NEXT K
NEXT J
locate 3,2
PRINT ACCFUGE
NEXT I
IF L=N THEN
PROPGRAV= 9.81/accpete
locate 2,25
PRINT " PROPGRAV ";PROPGRAV
SLEEP
END IF
LOCATE 7+10*L/N,0
PRINT L;" acpete "; accpete;" acfuge "; accfuge;" "; accfuge+accpete;" ";
IF (accfuge+accpete)*PROPGRAV>1 THEN
PRINT (accfuge+accpete)*PROPGRAV
ELSE
PRINT 0
END IF
L-=N/10
LOOP UNTIL L<0 font="" nbsp="">0>
ligne inutile ajouté par l'éditeur HTML> data-blogger-escaped-span="">
SLEEP
DIM AS DOUBLE accpete, accfuge,vol,pi,scale,PROPGRAV
DIM AS INTEGER I, J,K,L,M,N,TOTAL
PI=3.1415926
N=20
N*=10
'L=250
L=N
vol=1/3*Pi*N^3
PRINT "vol/4 = "; 1/3*Pi*N^3
SCALE = N/100
DO
LOCATE 1,40
PRINT "STARS ";TOTAL;" fract STARS/(VOL/4) :" ;TOTAL/VOL
TOTAL=0
accpete=0
accfuge=0
FOR I= -N-1 TO L+1
FOR J= 1 TO 1+int (SQR(N^2-I^2))
FOR K= 1 TO 1+int (SQR(N^2-I^2-J^2))
PSET (300+I/SCALE,400-J/SCALE),255
TOTAL+=1
accpete+=-(L-I)/((L-I)^2+J^2+K^2)^1.5
'locate 20,20
'PRINT ACCPETE
NEXT K
NEXT J
locate 2,2
PRINT ACCPETE
NEXT I
'PRINT TOTAL, VOL, ,accpete
PRINT TOTAL/VOL;
FOR I= L+2 TO N+1
FOR J= 1 TO 1+int (SQR(N^2-I^2))
FOR K= 1 TO 1+int (SQR(N^2-I^2-J^2))
PSET (300+I/SCALE,400-J/SCALE), &hD2E6FF
TOTAL+=1
accfuge+=-(L-I)/((L-I)^2+J^2+K^2)^1.5
'locate 20,30
'PRINT ACCFUGE
NEXT K
NEXT J
locate 3,2
PRINT ACCFUGE
NEXT I
IF L=N THEN
PROPGRAV= 9.81/accpete
locate 2,25
PRINT " PROPGRAV ";PROPGRAV
SLEEP
END IF
LOCATE 7+10*L/N,0
PRINT L;" acpete "; accpete;" acfuge "; accfuge;" "; accfuge+accpete;" ";
IF (accfuge+accpete)*PROPGRAV>1 THEN
PRINT (accfuge+accpete)*PROPGRAV
ELSE
PRINT 0
END IF
L-=N/10
LOOP UNTIL L<0 font="" nbsp="">0>
ligne inutile ajouté par l'éditeur HTML> data-blogger-escaped-span="">
SLEEP
Aucun commentaire:
Enregistrer un commentaire