球面調和関数
OPTION ARITHMETIC COMPLEX LET N=50 LET MODE=1 !'LET MAXLEVEL=5 INPUT PROMPT "(L>=M,L>=0) L,M=":L,M INPUT PROMPT "SAVE FILENAME(.MQO)=":F$ IF POS(F$,".")=0 THEN LET F$=F$ & ".MQO" !'FOR L=0 TO MAXLEVEL !'FOR M=0 TO L !'LET F$="球面調和関数" & STR$(L) & "-" & STR$(M) & ".MQO" OPEN #1:NAME F$ PRINT #1:"Metasequoia Document" PRINT #1:"Format Text Ver 1.0" PRINT #1 PRINT #1:"Scene {" PRINT #1:CHR$(9);"pos 0.0000 0.0000 1500.0000" PRINT #1:CHR$(9);"lookat 0.0000 0.0000 0.0000" PRINT #1:CHR$(9);"head -0.5236" PRINT #1:CHR$(9);"pich 0.5236" PRINT #1:CHR$(9);"ortho 0" PRINT #1:CHR$(9);"zoom2 5.0000" PRINT #1:CHR$(9);"amb 0.250 0.250 0.250" PRINT #1:"}" PRINT #1:"Object ";CHR$(34);"obj";CHR$(34);" {" PRINT #1:CHR$(9);"depth 0" PRINT #1:CHR$(9);"folding 0" PRINT #1:CHR$(9);"scale 1.000000 1.000000 1.000000" PRINT #1:CHR$(9);"rotation 0.000000 0.000000 0.000000" PRINT #1:CHR$(9);"translation 0.000000 0.000000 0.000000" PRINT #1:CHR$(9);"visible 15" PRINT #1:CHR$(9);"locking 0" PRINT #1:CHR$(9);"shading 1" PRINT #1:CHR$(9);"facet 59.5" PRINT #1:CHR$(9);"color 0.898 0.498 0.698" PRINT #1:CHR$(9);"color_type 0" PRINT #1:CHR$(9);"vertex ";STR$(N*(N-1)+2);" {" LET ALPHA=0 LET BETA=0 LET X=-Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*COS(BETA*PI/180) LET Y=Y2(MODE,L,M,ALPHA,BETA)*COS(ALPHA*PI/180) LET Z=Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*SIN(BETA*PI/180) PRINT #1:CHR$(9);FORM$(X);" ";FORM$(Y);" ";FORM$(Z) FOR ALPHA=180/N TO 179 STEP 180/N FOR BETA=0 TO 359 STEP 360/N LET X=-Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*COS(BETA*PI/180) LET Y=Y2(MODE,L,M,ALPHA,BETA)*COS(ALPHA*PI/180) LET Z=Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*SIN(BETA*PI/180) PRINT #1:CHR$(9);FORM$(X);" ";FORM$(Y);" ";FORM$(Z) NEXT BETA NEXT ALPHA LET ALPHA=180 LET BETA=0 LET X=-Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*COS(BETA*PI/180) LET Y=Y2(MODE,L,M,ALPHA,BETA)*COS(ALPHA*PI/180) LET Z=Y2(MODE,L,M,ALPHA,BETA)*SIN(ALPHA*PI/180)*SIN(BETA*PI/180) PRINT #1:CHR$(9);FORM$(X);" ";FORM$(Y);" ";FORM$(Z) PRINT #1:CHR$(9);"}" PRINT #1:CHR$(9);"face ";STR$(N*N);" {" FOR I=1 TO N IF I=N THEN PRINT #1:CHR$(9);CHR$(9);"3 V(1 ";STR$(N);" 0)" ELSE PRINT #1:CHR$(9);CHR$(9);"3 V(0";" ";STR$(I+1);" ";STR$(I);")" END IF NEXT I FOR I=1 TO N*(N-2) IF MOD(I,N)=0 THEN PRINT #1:CHR$(9);CHR$(9);"4 V(";STR$(I);" ";STR$(I-N+1);" ";STR$(I+1);" ";STR$(I+N);")" ELSE PRINT #1:CHR$(9);CHR$(9);"4 V(";STR$(I);" ";STR$(I+1);" ";STR$(I+N+1);" ";STR$(I+N);")" END IF NEXT I
|