--> Géométrie dans l'espace Tétraèdre
Xmin = -10 Xmax = 7 Ymin = -9 Ymax = 8 a = 8 A1 = [0,0,Math.sqrt(2/3)*a] B1 = [Math.sqrt(3)*a/3,0,0] B1 = rot(B1,0.4) C1 = rot(B1,%PI*2/3) D1 = rot(C1,%PI*2/3) function rot(P,alpha){ Q = [0,0,0] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } couleur = noir point(A1) point(B1) point(C1) point(D1) segment(A1,B1) segment(A1,C1) segment(A1,D1) segment(C1,B1) segment(D1,B1) segment(D1,C1,[3,3]) Xmin = -10 Xmax = 7 Ymin = -9 Ymax = 8 a = 8 A0 = [0,0,Math.sqrt(2/3)*a] B0 = [Math.sqrt(3)*a/3,0,0] B0 = rotz(B0,0.4) C0 = rotz(B0,%PI*2/3) D0 = rotz(C0,%PI*2/3) setInterval(function (){trace()},100) function rotx(P,alpha){ Q = [ P[0] , 0 , 0 ] Q[1] = P[1]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[1]*sin(alpha)+P[2]*cos(alpha) return Q } function roty(P,alpha){ Q = [ 0 , P[1] , 0 ] Q[0] = P[0]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[0]*sin(alpha)+P[2]*cos(alpha) return Q } function rotz(P,alpha){ Q = [ 0 , 0 , P[2] ] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } function trace(){ peinture = blanc transparence = 1 couleur = blanc rectangle([-10,10],20,20) couleur = noir point(A0) point(B0) point(C0) point(D0) transparence = 0.1 peinture = bleu poly([A0,B0,C0]) peinture = jaune poly([A0,B0,D0]) peinture = vert poly([A0,C0,D0]) peinture = rouge poly([B0,C0,D0]) alpha = 0.05 beta = 0.02 gamma = -0.03 A0 = roty(rotx(rotz(A0,alpha),beta),gamma) B0 = roty(rotx(rotz(B0,alpha),beta),gamma) C0 = roty(rotx(rotz(C0,alpha),beta),gamma) D0 = roty(rotx(rotz(D0,alpha),beta),gamma) }
Cube
Xmin = -10 Xmax = 10 Ymin = -10 Ymax = 10 a = 8 A2 = [0,0,0] B2 = [a,0,0] C2 = [a,a,0] D2 = [0,a,0] E2 = [0,0,a] F2 = [a,0,a] G2 = [a,a,a] H2 = [0,a,a] point(A2) point(B2) point(C2) point(D2) point(E2) point(F2) point(G2) point(H2) segment(A2,B2,[3,3]) segment(C2,B2) segment(C2,D2) segment(A2,D2,[3,3]) segment(A2,E2,[3,3]) segment(B2,F2) segment(C2,G2) segment(D2,H2) segment(E2,F2) segment(F2,G2) segment(G2,H2) segment(H2,E2) Xmin = -10 Xmax = 10 Ymin = -10 Ymax = 10 a = 3 A2 = [-a,-a,-a] B2 = [a,-a,-a] C2 = [a,a,-a] D2 = [-a,a,-a] E2 = [-a,-a,a] F2 = [a,-a,a] G2 = [a,a,a] H2 = [-a,a,a] setInterval(function (){trace()},100) function rotx(P,alpha){ Q = [ P[0] , 0 , 0 ] Q[1] = P[1]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[1]*sin(alpha)+P[2]*cos(alpha) return Q } function roty(P,alpha){ Q = [ 0 , P[1] , 0 ] Q[0] = P[0]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[0]*sin(alpha)+P[2]*cos(alpha) return Q } function rotz(P,alpha){ Q = [ 0 , 0 , P[2] ] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) couleur = noir point(A2) point(B2) point(C2) point(D2) point(E2) point(F2) point(G2) point(H2) transparence = 0.2 peinture = bleu poly([A2,B2,C2,D2]) poly([E2,F2,G2,H2]) peinture = jaune poly([A2,E2,H2,D2]) poly([B2,C2,G2,F2]) peinture = rouge poly([A2,B2,F2,E2]) poly([C2,D2,H2,G2]) alpha = 0.05 beta = 0.02 gamma = -0.03 A2 = roty(rotx(rotz(A2,alpha),beta),gamma) B2 = roty(rotx(rotz(B2,alpha),beta),gamma) C2 = roty(rotx(rotz(C2,alpha),beta),gamma) D2 = roty(rotx(rotz(D2,alpha),beta),gamma) E2 = roty(rotx(rotz(E2,alpha),beta),gamma) F2 = roty(rotx(rotz(F2,alpha),beta),gamma) G2 = roty(rotx(rotz(G2,alpha),beta),gamma) H2 = roty(rotx(rotz(H2,alpha),beta),gamma) }
cl = 4 AP = [0,0,0] BP = [cl,0,0] CP = [cl,cl,0] DP = [0,cl,0] EP = [0,0,cl] FP = [cl,0,cl] GP = [cl,cl,cl] HP = [0,cl,cl] GP1 = [cl,cl,cl] HP1 = [0,cl,cl] FP2 = [cl,0,cl] GP2 = [cl,cl,cl] EP3 = [0,0,cl] HP3 = [0,cl,cl] aP = %PI/96 UP = [1,0,0] n = 0 setInterval(function (){trace()},50) function trace(){ n++ if( n == 48 ){ n=0; aP = -aP } transparence = 1 couleur = blanc peinture = blanc rectangle([-10,10],20,20) couleur = noir transparence = 0 poly([AP,BP,CP,DP]) poly([EP,FP,BP,AP]) poly([EP,FP,GP,HP]) poly([CP,DP,HP1,GP1]) poly([BP,CP,GP2,FP2]) poly([AP,DP,HP3,EP3]) EP = rotation3d(UP,aP,[0,0,0],EP) FP = rotation3d(UP,aP,[0,0,0],FP) GP = rotation3d(UP,1.5*aP,[0,0,0],GP) HP = rotation3d(UP,1.5*aP,[0,0,0],HP) GP1 = rotation3d(UP,-aP,[0,cl,0],GP1) HP1 = rotation3d(UP,-aP,[0,cl,0],HP1) FP2 = rotation3d([0,1,0],aP,[cl,0,0],FP2) GP2 = rotation3d([0,1,0],aP,[cl,0,0],GP2) EP3 = rotation3d([0,1,0],-aP,[0,0,0],EP3) HP3 = rotation3d([0,1,0],-aP,[0,0,0],HP3) } Octaèdre
Xmin = -10 Xmax = 6 Ymin = -10 Ymax = 6 a = 5 A1 = [a,0,0] B1 = [0,a,0] C1 = [0,0,a] D1 = [-a,0,0] E1 = [0,-a,0] F1 = [0,0,-a] point(A1) point(B1) point(C1) point(D1) point(E1) point(F1) segment(E1,F1) segment(E1,A1) segment(A1,F1) segment(B1,F1) segment(B1,A1) segment(E1,C1) segment(A1,C1) segment(C1,B1) segment(C1,D1,[3,3]) segment(B1,D1,[3,3]) segment(E1,D1,[3,3]) segment(F1,D1,[3,3]) Xmin = -10 Xmax = 6 Ymin = -10 Ymax = 6 a = 5 A1 = [a,0,0] B1 = [0,a,0] C1 = [0,0,a] D1 = [-a,0,0] E1 = [0,-a,0] F1 = [0,0,-a] setInterval(function (){trace()},100) function rotx(P,alpha){ Q = [ P[0] , 0 , 0 ] Q[1] = P[1]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[1]*sin(alpha)+P[2]*cos(alpha) return Q } function roty(P,alpha){ Q = [ 0 , P[1] , 0 ] Q[0] = P[0]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[0]*sin(alpha)+P[2]*cos(alpha) return Q } function rotz(P,alpha){ Q = [ 0 , 0 , P[2] ] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) couleur = noir point(A1) point(B1) point(C1) point(D1) point(E1) point(F1) segment(E1,F1) segment(E1,A1) segment(A1,F1) segment(B1,F1) segment(B1,A1) segment(E1,C1) segment(A1,C1) segment(C1,B1) segment(C1,D1) segment(B1,D1) segment(E1,D1) segment(F1,D1) alpha = 0.05 beta = 0.02 gamma = -0.03 A1 = roty(rotx(rotz(A1,alpha),beta),gamma) B1 = roty(rotx(rotz(B1,alpha),beta),gamma) C1 = roty(rotx(rotz(C1,alpha),beta),gamma) D1 = roty(rotx(rotz(D1,alpha),beta),gamma) E1 = roty(rotx(rotz(E1,alpha),beta),gamma) F1 = roty(rotx(rotz(F1,alpha),beta),gamma) }
Dodécaèdre
Xmin = -12 Xmax = 8 Ymin = -12 Ymax = 8 a = 6 f = (1+Math.sqrt(5))/2 A = [a/2,a*f/2,0] B = [a/2,-a*f/2,0] C = [-a/2,a*f/2,0] D = [-a/2,-a*f/2,0] E = [0,a/2,a*f/2] F = [0,a/2,-a*f/2] G = [0,-a/2,a*f/2] H = [0,-a/2,-a*f/2] I = [a*f/2,0,a/2] J = [-a*f/2,0,a/2] K = [a*f/2,0,-a/2] L = [-a*f/2,0,-a/2] cAIE = [(A[0]+I[0]+E[0])/3,(A[1]+I[1]+E[1])/3,(A[2]+I[2]+E[2])/3] point(cAIE) cGIE = [(G[0]+I[0]+E[0])/3,(G[1]+I[1]+E[1])/3,(G[2]+I[2]+E[2])/3] point(cGIE) cAIK = [(A[0]+I[0]+K[0])/3,(A[1]+I[1]+K[1])/3,(A[2]+I[2]+K[2])/3] point(cAIK) cACE = [(A[0]+C[0]+E[0])/3,(A[1]+C[1]+E[1])/3,(A[2]+C[2]+E[2])/3] point(cACE) segment(cAIE,cGIE) segment(cAIE,cAIK) segment(cAIE,cACE) cAKF = [(A[0]+K[0]+F[0])/3,(A[1]+K[1]+F[1])/3,(A[2]+K[2]+F[2])/3] point(cAKF) cIKB = [(I[0]+K[0]+B[0])/3,(I[1]+K[1]+B[1])/3,(I[2]+K[2]+B[2])/3] point(cIKB) segment(cAIK,cAKF) segment(cAIK,cIKB) cIGB = [(I[0]+G[0]+B[0])/3,(I[1]+G[1]+B[1])/3,(I[2]+G[2]+B[2])/3] point(cIGB) cHKB = [(H[0]+K[0]+B[0])/3,(H[1]+K[1]+B[1])/3,(H[2]+K[2]+B[2])/3] point(cHKB) segment(cIKB,cIGB) segment(cIKB,cHKB) cHKF = [(H[0]+K[0]+F[0])/3,(H[1]+K[1]+F[1])/3,(H[2]+K[2]+F[2])/3] point(cHKF) cHDB = [(H[0]+D[0]+B[0])/3,(H[1]+D[1]+B[1])/3,(H[2]+D[2]+B[2])/3] point(cHDB) segment(cHKB,cHDB) segment(cHKB,cHKF) cHLF = [(H[0]+L[0]+F[0])/3,(H[1]+L[1]+F[1])/3,(H[2]+L[2]+F[2])/3] point(cHLF) segment(cHKF,cAKF) segment(cHKF,cHLF,[3,3]) cACF = [(A[0]+C[0]+F[0])/3,(A[1]+C[1]+F[1])/3,(A[2]+C[2]+F[2])/3] point(cACF) segment(cAKF,cACF) segment(cACE,cACF) cLCF = [(L[0]+C[0]+F[0])/3,(L[1]+C[1]+F[1])/3,(L[2]+C[2]+F[2])/3] point(cLCF) segment(cLCF,cACF,[3,3]) segment(cLCF,cHLF,[3,3]) cLCJ = [(L[0]+C[0]+J[0])/3,(L[1]+C[1]+J[1])/3,(L[2]+C[2]+J[2])/3] point(cLCJ) segment(cLCF,cLCJ,[3,3]) cECJ = [(E[0]+C[0]+J[0])/3,(E[1]+C[1]+J[1])/3,(E[2]+C[2]+J[2])/3] point(cECJ) segment(cECJ,cACE) segment(cECJ,cLCJ,[3,3]) cLDJ = [(L[0]+D[0]+J[0])/3,(L[1]+D[1]+J[1])/3,(L[2]+D[2]+J[2])/3] point(cLDJ) segment(cLDJ,cLCJ,[3,3]) cGDJ = [(G[0]+D[0]+J[0])/3,(G[1]+D[1]+J[1])/3,(G[2]+D[2]+J[2])/3] point(cGDJ) segment(cLDJ,cGDJ,[3,3]) cLDH = [(L[0]+D[0]+H[0])/3,(L[1]+D[1]+H[1])/3,(L[2]+D[2]+H[2])/3] point(cLDH) segment(cLDJ,cLDH,[3,3]) segment(cHDB,cLDH,[3,3]) segment(cHLF,cLDH,[3,3]) segment(cIGB,cGIE) cDGB = [(D[0]+G[0]+B[0])/3,(D[1]+G[1]+B[1])/3,(D[2]+G[2]+B[2])/3] point(cDGB) segment(cIGB,cDGB) cDGJ = [(D[0]+G[0]+J[0])/3,(D[1]+G[1]+J[1])/3,(D[2]+G[2]+J[2])/3] point(cDGJ) segment(cDGJ,cDGB) cEGJ = [(E[0]+G[0]+J[0])/3,(E[1]+G[1]+J[1])/3,(E[2]+G[2]+J[2])/3] point(cEGJ) segment(cDGJ,cEGJ) cEGI = [(E[0]+G[0]+I[0])/3,(E[1]+G[1]+I[1])/3,(E[2]+G[2]+I[2])/3] point(cEGI) segment(cEGI,cEGJ) cEJC = [(E[0]+J[0]+C[0])/3,(E[1]+J[1]+C[1])/3,(E[2]+J[2]+C[2])/3] point(cEJC) segment(cEGJ,cEJC) segment(cHDB,cDGB) Xmin = -12 Xmax = 8 Ymin = -12 Ymax = 8 a = 6 f = (1+Math.sqrt(5))/2 alpha = 0 A3 = [a/2,a*f/2,0] B3 = [a/2,-a*f/2,0] C3 = [-a/2,a*f/2,0] D3 = [-a/2,-a*f/2,0] E3 = [0,a/2,a*f/2] F3 = [0,a/2,-a*f/2] G3 = [0,-a/2,a*f/2] H3 = [0,-a/2,-a*f/2] I3 = [a*f/2,0,a/2] J3 = [-a*f/2,0,a/2] K3 = [a*f/2,0,-a/2] L3 = [-a*f/2,0,-a/2] function rotx(P,alpha){ Q = [ P[0] , 0 , 0 ] Q[1] = P[1]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[1]*sin(alpha)+P[2]*cos(alpha) return Q } function roty(P,alpha){ Q = [ 0 , P[1] , 0 ] Q[0] = P[0]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[0]*sin(alpha)+P[2]*cos(alpha) return Q } function rotz(P,alpha){ Q = [ 0 , 0 , P[2] ] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } setTimeout( function (){trace()} ,200) function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) couleur = noir cAIE = [(A3[0]+I3[0]+E3[0])/3,(A3[1]+I3[1]+E3[1])/3,(A3[2]+I3[2]+E3[2])/3] //point(cAIE) cGIE = [(G3[0]+I3[0]+E3[0])/3,(G3[1]+I3[1]+E3[1])/3,(G3[2]+I3[2]+E3[2])/3] //point(cGIE) cAIK = [(A3[0]+I3[0]+K3[0])/3,(A3[1]+I3[1]+K3[1])/3,(A3[2]+I3[2]+K3[2])/3] //point(cAIK) cACE = [(A3[0]+C3[0]+E3[0])/3,(A3[1]+C3[1]+E3[1])/3,(A3[2]+C3[2]+E3[2])/3] //point(cACE) segment(cAIE,cGIE) segment(cAIE,cAIK) segment(cAIE,cACE) cAKF = [(A3[0]+K3[0]+F3[0])/3,(A3[1]+K3[1]+F3[1])/3,(A3[2]+K3[2]+F3[2])/3] //point(cAKF) cIKB = [(I3[0]+K3[0]+B3[0])/3,(I3[1]+K3[1]+B3[1])/3,(I3[2]+K3[2]+B3[2])/3] //point(cIKB) segment(cAIK,cAKF) segment(cAIK,cIKB) cIGB = [(I3[0]+G3[0]+B3[0])/3,(I3[1]+G3[1]+B3[1])/3,(I3[2]+G3[2]+B3[2])/3] //point(cIGB) cHKB = [(H3[0]+K3[0]+B3[0])/3,(H3[1]+K3[1]+B3[1])/3,(H3[2]+K3[2]+B3[2])/3] //point(cHKB) segment(cIKB,cIGB) segment(cIKB,cHKB) cHKF = [(H3[0]+K3[0]+F3[0])/3,(H3[1]+K3[1]+F3[1])/3,(H3[2]+K3[2]+F3[2])/3] //point(cHKF) cHDB = [(H3[0]+D3[0]+B3[0])/3,(H3[1]+D3[1]+B3[1])/3,(H3[2]+D3[2]+B3[2])/3] //point(cHDB) segment(cHKB,cHDB) segment(cHKB,cHKF) cHLF = [(H3[0]+L3[0]+F3[0])/3,(H3[1]+L3[1]+F3[1])/3,(H3[2]+L3[2]+F3[2])/3] //point(cHLF) segment(cHKF,cAKF) segment(cHKF,cHLF,[3,3]) cACF = [(A3[0]+C3[0]+F3[0])/3,(A3[1]+C3[1]+F3[1])/3,(A3[2]+C3[2]+F3[2])/3] //point(cACF) segment(cAKF,cACF) segment(cACE,cACF) cLCF = [(L3[0]+C3[0]+F3[0])/3,(L3[1]+C3[1]+F3[1])/3,(L3[2]+C3[2]+F3[2])/3] //point(cLCF) segment(cLCF,cACF,[3,3]) segment(cLCF,cHLF,[3,3]) cLCJ = [(L3[0]+C3[0]+J3[0])/3,(L3[1]+C3[1]+J3[1])/3,(L3[2]+C3[2]+J3[2])/3] //point(cLCJ) segment(cLCF,cLCJ,[3,3]) cECJ = [(E3[0]+C3[0]+J3[0])/3,(E3[1]+C3[1]+J3[1])/3,(E3[2]+C3[2]+J3[2])/3] //point(cECJ) segment(cECJ,cACE) segment(cECJ,cLCJ,[3,3]) cLDJ = [(L3[0]+D3[0]+J3[0])/3,(L3[1]+D3[1]+J3[1])/3,(L3[2]+D3[2]+J3[2])/3] //point(cLDJ) segment(cLDJ,cLCJ,[3,3]) cGDJ = [(G3[0]+D3[0]+J3[0])/3,(G3[1]+D3[1]+J3[1])/3,(G3[2]+D3[2]+J3[2])/3] //point(cGDJ) segment(cLDJ,cGDJ,[3,3]) cLDH = [(L3[0]+D3[0]+H3[0])/3,(L3[1]+D3[1]+H3[1])/3,(L3[2]+D3[2]+H3[2])/3] //point(cLDH) segment(cLDJ,cLDH,[3,3]) segment(cHDB,cLDH,[3,3]) segment(cHLF,cLDH,[3,3]) segment(cIGB,cGIE) cDGB = [(D3[0]+G3[0]+B3[0])/3,(D3[1]+G3[1]+B3[1])/3,(D3[2]+G3[2]+B3[2])/3] //point(cDGB) segment(cIGB,cDGB) cDGJ = [(D3[0]+G3[0]+J3[0])/3,(D3[1]+G3[1]+J3[1])/3,(D3[2]+G3[2]+J3[2])/3] //point(cDGJ) segment(cDGJ,cDGB) cEGJ = [(E3[0]+G3[0]+J3[0])/3,(E3[1]+G3[1]+J3[1])/3,(E3[2]+G3[2]+J3[2])/3] //point(cEGJ) segment(cDGJ,cEGJ) cEGI = [(E3[0]+G3[0]+I3[0])/3,(E3[1]+G3[1]+I3[1])/3,(E3[2]+G3[2]+I3[2])/3] //point(cEGI) segment(cEGI,cEGJ) cEJC = [(E3[0]+J3[0]+C3[0])/3,(E3[1]+J3[1]+C3[1])/3,(E3[2]+J3[2]+C3[2])/3] //point(cEJC) segment(cEGJ,cEJC) segment(cHDB,cDGB) transparence = 0.4 peinture = bleu poly([cAIE,cGIE,cIGB,cIKB,cAIK]) poly([cECJ,cACE,cACF,cLCF,cLCJ]) poly([cHDB,cDGB,cGDJ,cLDJ,cLDH]) peinture = jaune poly([cAIE,cACE,cACF,cAKF,cAIK]) poly([cIGB,cDGB,cGDJ,cEGJ,cGIE]) poly([cHKF,cHLF,cLDH,cHDB,cHKB]) peinture = vert poly([cAIK,cAKF,cHKF,cHKB,cIKB]) poly([cECJ,cLCJ,cLDJ,cGDJ,cEGJ]) poly([cHLF,cLDH,cLDJ,cLCJ,cLCF]) peinture = rouge poly([cHKB,cHDB,cDGB,cIGB,cIKB]) poly([cGIE,cEGJ,cECJ,cACE,cAIE]) poly([cHKF,cHLF,cLCF,cACF,cAKF]) transparence = 0 alpha = 0.02 beta = 0.005 gamma = -0.02 A3 = roty(rotx(rotz(A3,alpha),beta),gamma) B3 = roty(rotx(rotz(B3,alpha),beta),gamma) C3 = roty(rotx(rotz(C3,alpha),beta),gamma) D3 = roty(rotx(rotz(D3,alpha),beta),gamma) E3 = roty(rotx(rotz(E3,alpha),beta),gamma) F3 = roty(rotx(rotz(F3,alpha),beta),gamma) G3 = roty(rotx(rotz(G3,alpha),beta),gamma) H3 = roty(rotx(rotz(H3,alpha),beta),gamma) I3 = roty(rotx(rotz(I3,alpha),beta),gamma) J3 = roty(rotx(rotz(J3,alpha),beta),gamma) K3 = roty(rotx(rotz(K3,alpha),beta),gamma) L3 = roty(rotx(rotz(L3,alpha),beta),gamma) setTimeout( function (){trace()} ,50) }
Icosaèdre
Xmin = -12 Xmax = 8 Ymin = -12 Ymax = 8 a = 6 f = (1+Math.sqrt(5))/2 A = [a/2,a*f/2,0] B = [a/2,-a*f/2,0] C = [-a/2,a*f/2,0] D = [-a/2,-a*f/2,0] E = [0,a/2,a*f/2] F = [0,a/2,-a*f/2] G = [0,-a/2,a*f/2] H = [0,-a/2,-a*f/2] I = [a*f/2,0,a/2] J = [-a*f/2,0,a/2] K = [a*f/2,0,-a/2] L = [-a*f/2,0,-a/2] point(A) point(B) point(C) point(D) point(E) point(F) point(G) point(H) point(I) point(J) point(K) point(L) segment(F,H) segment(F,A) segment(F,C) segment(F,K) segment(F,L,[3,3]) segment(H,K) segment(A,K) segment(A,C) segment(C,L,[3,3]) segment(L,H,[3,3]) segment(H,B) segment(K,B) segment(K,I) segment(A,I) segment(A,E) segment(C,E) segment(C,J,[3,3]) segment(E,J,[3,3]) segment(I,E) segment(G,E) segment(E,G,[3,3]) segment(L,J,[3,3]) segment(D,J,[3,3]) segment(I,E) segment(I,G) segment(I,B) segment(D,B,[3,3]) segment(G,B) segment(D,G,[3,3]) segment(D,H,[3,3]) segment(D,L,[3,3]) segment(J,G,[3,3]) Xmin = -12 Xmax = 8 Ymin = -12 Ymax = 8 a = 6 f = (1+Math.sqrt(5))/2 A4 = [a/2,a*f/2,0] B4 = [a/2,-a*f/2,0] C4 = [-a/2,a*f/2,0] D4 = [-a/2,-a*f/2,0] E4 = [0,a/2,a*f/2] F4 = [0,a/2,-a*f/2] G4 = [0,-a/2,a*f/2] H4 = [0,-a/2,-a*f/2] I4 = [a*f/2,0,a/2] J4 = [-a*f/2,0,a/2] K4 = [a*f/2,0,-a/2] L4 = [-a*f/2,0,-a/2] setInterval(function (){trace()},100) function rotx(P,alpha){ Q = [ P[0] , 0 , 0 ] Q[1] = P[1]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[1]*sin(alpha)+P[2]*cos(alpha) return Q } function roty(P,alpha){ Q = [ 0 , P[1] , 0 ] Q[0] = P[0]*cos(alpha)-P[2]*sin(alpha) Q[2] = P[0]*sin(alpha)+P[2]*cos(alpha) return Q } function rotz(P,alpha){ Q = [ 0 , 0 , P[2] ] Q[0] = P[0]*cos(alpha)-P[1]*sin(alpha) Q[1] = P[0]*sin(alpha)+P[1]*cos(alpha) return Q } function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) couleur = noir point(A4) point(B4) point(C4) point(D4) point(E4) point(F4) point(G4) point(H4) point(I4) point(J4) point(K4) point(L4) segment(F4,H4) segment(F4,A4) segment(F4,C4) segment(F4,K4) segment(F4,L4) segment(H4,K4) segment(A4,K4) segment(A4,C4) segment(C4,L4) segment(L4,H4) segment(H4,B4) segment(K4,B4) segment(K4,I4) segment(A4,I4) segment(A4,E4) segment(C4,E4) segment(C4,J4) segment(E4,J4) segment(I4,E4) segment(G4,E4) segment(E4,G4) segment(L4,J4) segment(D4,J4) segment(I4,E4) segment(I4,G4) segment(I4,B4) segment(D4,B4) segment(G4,B4) segment(D4,G4) segment(D4,H4) segment(D4,L4) segment(J4,G4) alpha = 0.05 beta = 0.02 gamma = -0.03 A4 = roty(rotx(rotz(A4,alpha),beta),gamma) B4 = roty(rotx(rotz(B4,alpha),beta),gamma) C4 = roty(rotx(rotz(C4,alpha),beta),gamma) D4 = roty(rotx(rotz(D4,alpha),beta),gamma) E4 = roty(rotx(rotz(E4,alpha),beta),gamma) F4 = roty(rotx(rotz(F4,alpha),beta),gamma) G4 = roty(rotx(rotz(G4,alpha),beta),gamma) H4 = roty(rotx(rotz(H4,alpha),beta),gamma) I4 = roty(rotx(rotz(I4,alpha),beta),gamma) J4 = roty(rotx(rotz(J4,alpha),beta),gamma) K4 = roty(rotx(rotz(K4,alpha),beta),gamma) L4 = roty(rotx(rotz(L4,alpha),beta),gamma) }
Plans et droites Plans paralléles
A5 = [0,-5,0] B5 = [5,-5,0] C5 = [5,9,0] D5 = [0,9,0] E5 = [0,-5,5] F5 = [5,-5,5] G5 = [5,9,5] H5 = [0,9,5] transparence = 0.3 peinture = vert poly([A5,B5,C5,D5]) poly([E5,F5,G5,H5]) A5 = [-2,-5,0] B5 = [5,-5,0] C5 = [5,9,0] D5 = [-2,9,0] E5 = [-2,-5,3] F5 = [5,-5,3] G5 = [5,9,3] H5 = [-2,9,3] U = [0,1,1] C = [2.5,3,2.5] a = 0.03 setInterval(function (){trace()},50) function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) transparence = 0.3 couleur = noir peinture = vert poly([A5,B5,C5,D5]) poly([E5,F5,G5,H5]) A5 = rotation3d(U,a,C,A5) B5 = rotation3d(U,a,C,B5) C5 = rotation3d(U,a,C,C5) D5 = rotation3d(U,a,C,D5) E5 = rotation3d(U,a,C,E5) F5 = rotation3d(U,a,C,F5) G5 = rotation3d(U,a,C,G5) H5 = rotation3d(U,a,C,H5) }
Plans sécants
A6 = [0,-5,0] B6 = [5,-5,0] C6 = [5,9,5] D6 = [0,9,5] E6 = [0,-5,5] F6 = [5,-5,5] G6 = [5,9,0] H6 = [0,9,0] I6 = [5,2,2.5] J6 = [0,2,2.5] segment(I6,J6) transparence = 0.3 peinture = rouge poly([A6,B6,C6,D6]) poly([E6,F6,G6,H6]) A6 = [0,-5,0] B6 = [5,-5,0] C6 = [5,9,5] D6 = [0,9,5] E6 = [0,-5,5] F6 = [5,-5,5] G6 = [5,9,0] H6 = [0,9,0] I6 = [5,2,2.5] J6 = [0,2,2.5] U6 = [0,1,1] CC = [2.5,3,2.5] a6 = 0.03 setInterval(function (){trace()},50) function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) transparence = 0.3 couleur = noir peinture = rouge poly([A6,B6,C6,D6]) poly([E6,F6,G6,H6]) A6 = rotation3d(U6,a6,CC,A6) B6 = rotation3d(U6,a6,CC,B6) C6 = rotation3d(U6,a6,CC,C6) D6 = rotation3d(U6,a6,CC,D6) E6 = rotation3d(U6,a6,CC,E6) F6 = rotation3d(U6,a6,CC,F6) G6 = rotation3d(U6,a6,CC,G6) H6 = rotation3d(U6,a6,CC,H6) I6 = rotation3d(U6,a6,CC,I6) J6 = rotation3d(U6,a6,CC,J6) segment(I6,J6) }
Plans parallèles et plans sécants
A7 = [0,-5,0] B7 = [5,-5,0] C7 = [5,9,5] D7 = [0,9,5] E7 = [0,-5,4] F7 = [5,-5,4] G7 = [5,9,4] H7 = [0,9,4] I7 = [0,-5,1] J7 = [5,-5,1] K7 = [5,9,1] L7 = [0,9,1] M7 = [0,-2.1,1] N7 = [5,-2.1,1] O7 = [0,6.2,4] P7 = [5,6.2,4] transparence = 0.3 peinture = jaune poly([A7,B7,C7,D7]) peinture = bleu poly([E7,F7,G7,H7]) poly([I7,J7,K7,L7]) segment(M7,N7) segment(O7,P7) A7 = [0,-5,0] B7 = [5,-5,0] C7 = [5,9,5] D7 = [0,9,5] E7 = [0,-5,4] F7 = [5,-5,4] G7 = [5,9,4] H7 = [0,9,4] I7 = [0,-5,1] J7 = [5,-5,1] K7 = [5,9,1] L7 = [0,9,1] M7 = [0,-2.1,1] N7 = [5,-2.1,1] O7 = [0,6.2,4] P7 = [5,6.2,4] U7 = [0,1,1] CA = [2.5,3,2.5] a7 = 0.03 setInterval(function (){trace()},50) function trace(){ transparence = 1 peinture = blanc couleur = blanc rectangle([-10,10],20,20) couleur = noir transparence = 0.3 peinture = jaune poly([A7,B7,C7,D7]) peinture = bleu poly([E7,F7,G7,H7]) poly([I7,J7,K7,L7]) segment(M7,N7) segment(O7,P7) A7 = rotation3d(U7,a7,CA,A7) B7 = rotation3d(U7,a7,CA,B7) C7 = rotation3d(U7,a7,CA,C7) D7 = rotation3d(U7,a7,CA,D7) E7 = rotation3d(U7,a7,CA,E7) F7 = rotation3d(U7,a7,CA,F7) G7 = rotation3d(U7,a7,CA,G7) H7 = rotation3d(U7,a7,CA,H7) I7 = rotation3d(U7,a7,CA,I7) J7 = rotation3d(U7,a7,CA,J7) K7 = rotation3d(U7,a7,CA,K7) L7 = rotation3d(U7,a7,CA,L7) M7 = rotation3d(U7,a7,CA,M7) N7 = rotation3d(U7,a7,CA,N7) O7 = rotation3d(U7,a7,CA,O7) P7 = rotation3d(U7,a7,CA,P7) }
Droites et plans
A8 = [-3,-5,0] B8 = [7,-5,0] C8 = [7,9,0] D8 = [-3,9,0] transparence = 0.3 peinture = vert poly([A8,B8,C8,D8]) Inter = [2.5,2.5,0] point(Inter) //droiteParam(Inter,[0.5,0.5,1]) segment(Inter,[7.5,7.5,10]) segment(Inter,[2,2,-1],[3,3]) segment([2,2,-1],[2.5+0.5*(-8),2.5+0.5*(-8),-8]) A8 = [-3,-5,0] B8 = [7,-5,0] C8 = [7,9,0] D8 = [-3,9,0] E8 = [0,0,1] Inter = [2,2.5,0] ad = 0.05 setInterval(function (){trace()},50) function trace(){ transparence = 1 couleur = blanc peinture = blanc rectangle([-10,10],20,20) couleur = noir transparence = 0.3 peinture = vert poly([A8,B8,C8,D8]) point(Inter) droiteParam(Inter,E8) A8 = rotation3d(E8,ad,Inter,A8) B8 = rotation3d(E8,ad,Inter,B8) C8 = rotation3d(E8,ad,Inter,C8) D8 = rotation3d(E8,ad,Inter,D8) }
Paraboloïde
Xmin = -9 Xmax = 5 Ymin = -4 Ymax = 10 for(r=0;r<40;r=r+0.2){ T = [] for(i=0;i<2*%PI;i=i+0.05){ T.push([r*cos(i),r*sin(i),0.3*r*r]) } poly(T) } for(x=-40;x<40;x=x+0.4){ T = [] for(y=-40;y<40;y=y+0.05){ T.push([x,y,0.3*(x*x+y*y)]) } poly(T) }