Optimisation du volume d'une boîte
Author: Vincent SAMUEL
Date: 19/12/2005

hauteur (cm)

Volume (cm³)

A = Point(yAxis)
B = (10, -2)
C = (10, -12)
D = Point(yAxis)
P, a, b, c, d = Polygon(A, B, C, D)
E = Midpoint(A, B)
e = Segment(A, E)
F = Point(e)
G = Mirror(F, E)
H = Midpoint(A, D)
I = Rotate(F, 270°, A)
J = Mirror(I, H)
d1 = Line(I, a)
d2 = Line(H, d1)
d3 = Line(J, d2)
d4 = Line(F, b)
d5 = Line(E, d4)
d6 = Line(G, d5)
K = Intersect(d4, d1)
L = Intersect(d6, d1)
M = Intersect(d3, d6)
N = Intersect(d4, d3)
O = Intersect(xAxis, yAxis)
V = Point(yAxis)
U = Point(xAxis)
u = Vector(O, U)
v = Vector(O, V)
Q = Intersect(d1, b)
R = Intersect(d3, b)
S = Intersect(c, d6)
T = Intersect(c, d4)
W = Intersect(d5, d1)
w = Vector(K, W)
z = Vector(K, F)
Y = Point(d2)
Z = (-15, 1)
d7 = Line(Z, Y)
A_1 = Translate(Y, w)
B_1 = Mirror(A_1, Y)
C_1 = Intersect(d1, d7)
f = 0.7
D_1 = Dilate(C_1, f, Y)
E_1 = Mirror(D_1, Y)
F_1 = Translate(E_1, w)
G_1 = Translate(D_1, w)
H_1 = Mirror(G_1, D_1)
I_1 = Mirror(F_1, E_1)
J_1 = Translate(F_1, z)
K_1 = Translate(G_1, z)
L_1 = Translate(H_1, z)
M_1 = Translate(I_1, z)
P_1, i_1, f_1, j_1, m_1 = Polygon(I_1, F_1, J_1, M_1)
Q_1, j_2, k_1, l_1, m_2 = Polygon(J_1, K_1, L_1, M_1)
R_1, i_2, m_3, l_2, h_1 = Polygon(I_1, M_1, L_1, H_1)
g = Function((4 x³ - 40 x² + 100 x) / 10, 0, 5)
N_1 = Intersect(g, d4, 1)
h = Segment(H_1, G_1)
i = Segment(G_1, K_1)
j = Segment(G_1, F_1)
k = Segment(I, K)
l = Segment(K, F)
m = Segment(G, L)
n = Segment(L, Q)
p = Segment(R, M)
q = Segment(M, S)
r = Segment(T, N)
s = Segment(N, J)
O_1 = Intersect(d4, xAxis)
t = Segment(O_1, N_1)
a_1 = OrthogonalLine(N_1, t)
S_1 = Intersect(a_1, yAxis)
b_1 = Segment(S_1, N_1)
T_1, k_2, l_3, m_4, n_1 = Polygon(K, L, M, N)
hauteur = Distance(A, F)
T1: "hauteur = " + hauteur + " cm"
T2: "Volume = " + (4 hauteur³ - 40 hauteur² + 100 hauteur) + " cm³"