|
|
#fopen FOO "polyordr.txt" write
#declare
Name=array[12]{"Linear","Quadric","Cubic","Quartic","Quintic","Sextic","Septic","Octic","Nonic","Decic","Undecic","Dodecic"}
#declare O=1;
#while (O<=12) // Highest order
#write(FOO,concat(Name[O-1],"\n"))
#declare C=1;
#declare X=O;
#while (X>=0)
#declare Y=O-X;
#while (Y>=0)
#declare Z=O-X-Y;
#while (Z>=0)
#declare STR=concat(str(C,3,0)," ")
#if (X>0)
#declare STR=concat(STR,"x")
#if (X>1)
#declare STR=concat(STR,str(X,1,0))
#end
#end
#if (Y>0)
#declare STR=concat(STR,"y")
#if (Y>1)
#declare STR=concat(STR,str(Y,1,0))
#end
#end
#if (Z>0)
#declare STR=concat(STR,"z")
#if (Z>1)
#declare STR=concat(STR,str(Z,1,0))
#end
#end
#if (X+Y+Z=0)
#declare STR=concat(STR,"1")
#end
#declare STR=concat(STR,"\n")
#write(FOO,STR)
#declare C=C+1;
#declare Z=Z-1;
#end
#declare Y=Y-1;
#end
#declare X=X-1;
#end
#write(FOO,"\f")
#declare O=O+1;
#end
#fclose FOO
sphere { 0,1 }
--
David Fontaine <dav### [at] faricynet> ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/
Post a reply to this message
|
|