-->
Solides de Platon
Tétraèdre
Xmin = -10
Xmax = 7
Ymin = -9
Ymax = 8
a = 8
A = [0,0,Math.sqrt(2/3)*a]
B = [Math.sqrt(3)*a/3,0,0]
B = rot(B,0.4)
C = rot(B,%PI*2/3)
D = rot(C,%PI*2/3)
trace()
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
}
function trace(){
peinture = blanc
transparence = 1
couleur = blanc
rectangle([-10,10],20,20)
couleur = noir
point(A)
point(B)
point(C)
point(D)
segment(A,B)
segment(A,C)
segment(A,D)
segment(C,B)
segment(D,B)
segment(D,C,[3,3])
t = t + 0.001
B = rot(B,t)
C = rot(B,%PI*2/3)
D = rot(C,%PI*2/3)
}
Hexaèdre ou 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)
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])
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
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]
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 = [(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)
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
A = roty(rotx(rotz(A,alpha),beta),gamma)
B = roty(rotx(rotz(B,alpha),beta),gamma)
C = roty(rotx(rotz(C,alpha),beta),gamma)
D = roty(rotx(rotz(D,alpha),beta),gamma)
E = roty(rotx(rotz(E,alpha),beta),gamma)
F = roty(rotx(rotz(F,alpha),beta),gamma)
G = roty(rotx(rotz(G,alpha),beta),gamma)
H = roty(rotx(rotz(H,alpha),beta),gamma)
I = roty(rotx(rotz(I,alpha),beta),gamma)
J = roty(rotx(rotz(J,alpha),beta),gamma)
K = roty(rotx(rotz(K,alpha),beta),gamma)
L = roty(rotx(rotz(L,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])