This commit is contained in:
2026-05-18 10:47:39 +02:00
parent 8fd3f47a20
commit 17431d662f
3 changed files with 9983 additions and 8660 deletions

View File

@ -2578,8 +2578,9 @@
cetz.canvas(length: 1cm, {
import cetz.draw: *
let col_left = blue.darken(10%) // Bit 0 (Inversé)
let col_right = red.darken(10%) // Bit 1 (Inversé)
// Couleurs ajustées selon la logique mathématique
let col_bit1 = red.darken(10%) // Négatif -> Bit 1
let col_bit0 = blue.darken(10%) // Positif -> Bit 0
let col_ax = black
let col_mid = gray.darken(30%)
@ -2587,16 +2588,17 @@
let y0 = 0.0
let y_top = 1.8
// ── 1. Zones colorées (Dessinées en PREMIER, en HAUT) ──
// Zone gauche (négative) -> Bit 0
rect((-L, y0 + 0.02), (-0.05, y0 + 0.32), fill: col_left.lighten(92%), stroke: none)
content((-L / 2, y0 + 0.65), text(fill: col_left, weight: "bold", size: 0.9em)[Bit = 0])
// ── 1. Zones colorées (Corrigées) ──
// Zone droite (positive) -> Bit 1
rect((0.05, y0 + 0.02), (L, y0 + 0.32), fill: col_right.lighten(92%), stroke: none)
content((L / 2, y0 + 0.65), text(fill: col_right, weight: "bold", size: 0.9em)[Bit = 1])
// Zone gauche (négative) -> Bit 1
rect((-L, y0 + 0.02), (-0.05, y0 + 0.32), fill: col_bit1.lighten(92%), stroke: none)
content((-L / 2, y0 + 0.65), text(fill: col_bit1, weight: "bold", size: 0.9em)[Bit = 1])
// ── 2. Axe horizontal (Dessiné APRÈS pour passer AU-DESSUS) ──
// Zone droite (positive) -> Bit 0
rect((0.05, y0 + 0.02), (L, y0 + 0.32), fill: col_bit0.lighten(92%), stroke: none)
content((L / 2, y0 + 0.65), text(fill: col_bit0, weight: "bold", size: 0.9em)[Bit = 0])
// ── 2. Axe horizontal ──
line((-L, y0), (L, y0), stroke: 1.8pt + col_ax, mark: (end: "stealth", fill: col_ax, size: 0.22))
content((L + 0.5, y0), text(size: 0.85em)[$L(v_i)$], anchor: "west")
@ -2604,41 +2606,40 @@
line((0, -0.2), (0, 0.2), stroke: 1.5pt + col_mid)
content((0, -0.5), text(size: 0.8em, fill: col_mid)[0])
// ── 4. Points exemples (Sans les Volts) ──
// ── 4. Points exemples (Couleurs mises à jour) ──
// -6 (Bit 0 à gauche)
// -6 (Bit 1 à gauche désormais)
let px_left = -5.0
circle((px_left, y0), radius: 0.15, fill: col_left, stroke: none)
// La ligne pointillée part de l'axe vers le haut
line((px_left, y0), (px_left, y_top), stroke: (paint: col_left, thickness: 1pt, dash: "dashed"))
circle((px_left, y0), radius: 0.15, fill: col_bit1, stroke: none)
line((px_left, y0), (px_left, y_top), stroke: (paint: col_bit1, thickness: 1pt, dash: "dashed"))
content(
(px_left, y_top + 0.1),
box(fill: col_left.lighten(92%), stroke: 0.5pt + col_left, radius: 3pt, inset: 4pt)[
#text(fill: col_left, weight: "bold", size: 0.75em)[$-6$]
box(fill: col_bit1.lighten(92%), stroke: 0.5pt + col_bit1, radius: 3pt, inset: 4pt)[
#text(fill: col_bit1, weight: "bold", size: 0.75em)[$-6$]
],
anchor: "south",
)
// +0.3 (Proche de zéro, Bit 1)
// +0.3 (Proche de zéro, Bit 0)
let px_near = 0.6
circle((px_near, y0), radius: 0.15, fill: col_right.lighten(40%), stroke: none)
line((px_near, y0), (px_near, y_top - 0.7), stroke: (paint: col_right.lighten(20%), thickness: 1pt, dash: "dashed"))
circle((px_near, y0), radius: 0.15, fill: col_bit0.lighten(40%), stroke: none)
line((px_near, y0), (px_near, y_top - 0.7), stroke: (paint: col_bit0.lighten(20%), thickness: 1pt, dash: "dashed"))
content(
(px_near, y_top - 0.65),
box(fill: white, stroke: 0.5pt + col_right.lighten(30%), radius: 3pt, inset: 3pt)[
#text(fill: col_right.darken(20%), size: 0.7em)[$+0.3$]
box(fill: white, stroke: 0.5pt + col_bit0.lighten(30%), radius: 3pt, inset: 3pt)[
#text(fill: col_bit0.darken(20%), size: 0.7em)[$+0.3$]
],
anchor: "south-west",
)
// +10 (Bit 1 à droite)
// +10 (Bit 0 à droite)
let px_right = 5.8
circle((px_right, y0), radius: 0.15, fill: col_right, stroke: none)
line((px_right, y0), (px_right, y_top), stroke: (paint: col_right, thickness: 1pt, dash: "dashed"))
circle((px_right, y0), radius: 0.15, fill: col_bit0, stroke: none)
line((px_right, y0), (px_right, y_top), stroke: (paint: col_bit0, thickness: 1pt, dash: "dashed"))
content(
(px_right, y_top + 0.1),
box(fill: col_right.lighten(92%), stroke: 0.5pt + col_right, radius: 3pt, inset: 4pt)[
#text(fill: col_right, weight: "bold", size: 0.75em)[$+10$]
box(fill: col_bit0.lighten(92%), stroke: 0.5pt + col_bit0, radius: 3pt, inset: 4pt)[
#text(fill: col_bit0, weight: "bold", size: 0.75em)[$+10$]
],
anchor: "south",
)