From 638af314ea0ac3ddac3d91cb2cc6a0e6804c2aa8 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Minh Date: Thu, 30 Apr 2026 00:17:26 +0700 Subject: [PATCH] =?UTF-8?q?v0.0.3.0=20feat(module-1):=20drag-to-explore=20?= =?UTF-8?q?tam=20gi=C3=A1c=20b=E1=BA=B1ng=20nhau=20(l=E1=BB=9Bp=207,=20SSS?= =?UTF-8?q?)=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(geom-engine): triangle module + position-strict congruentSSS Third pure module under src/geom-engine/. Adds Triangle type, sides() (returns named AB / BC / CA lengths), and congruentSSS() with position-strict semantics: labels define the correspondence (AB↔A'B', BC↔B'C', CA↔C'A'), permuted matches are NOT counted as congruent. This preserves SGK pedagogy where the labels and the matched-pair encoding (color + tick marks) carry meaning. 10 new unit tests: identical, translated-congruent, similar-not-congruent (2x scale), shape-different, EPSILON_LEN tolerance (within and just outside), label-permutation rejection, and symmetry of the relation. Total tests: 29 → 39. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(module-1): drag-to-explore tam giác bằng nhau (lớp 7, SSS) Second interactive theorem demo. Page at /lop-7/tam-giac-bang-nhau/. Component: src/components/congruence-sss.ts owns 6 draggable vertices (3 per triangle), each independently captured via setPointerCapture per vertex. Drag-clamping (16px viewBox padding) keeps every vertex on-screen. Encoding per autoplan Decision D3 (a11y + SGK-correct in one move): AB / A'B' → pair1 #D7263D + 1 tick BC / B'C' → pair2 #1B998B + 2 ticks CA / C'A' → pair3 #F46036 + 3 ticks Tick marks are SVG line segments perpendicular to each side at the midpoint, spaced 5 viewBox-units apart for multi-tick. Redrawn live during drag. Page: viewBox 400x300 (4:3, side-by-side triangles), single 6KB page including inline JS bundle (entire geom-engine + canvas controller, minified). Live side-length readout table + green badge "Hai tam giác bằng nhau (c.c.c)" that appears when SSS condition holds within EPSILON_LEN. Badge has role="status" + aria-live="polite" so screen readers announce the moment the triangles become congruent. Rigid-motion overlay animation EXPLICITLY DROPPED per autoplan — color+tick match is the success state. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(hub): activate lớp 7 card linking to tam giác bằng nhau module Status flips from sap-ra-mat to live; href points at the new module. i18n/vi.ts gains module1.* strings (intro, instruction, theorem, example, SGK-aligned theorem statement) so every user-facing string still routes through t() — adding English in the future is one en.ts file away. Co-Authored-By: Claude Opus 4.7 (1M context) * chore: VERSION 0.0.3.0 + CHANGELOG + TODOS update v0.0.3.0 = scaffold + Module 3 (góc nội tiếp) + Module 1 (tam giác bằng nhau). 2 of 3 MVP modules now live. Module 2 (tam giác đồng dạng) is next. Co-Authored-By: Claude Opus 4.7 (1M context) * chore: TODOS Module 1 reflects v0.0.3.0 (SSS shipped) Original P1 items "SSS detector" + "SGK tick-mark encoding" already moved to Completed in the previous commit. Replace the still-pending M1 section with the actual remaining work: P2 toggles for SAS/ASA/AAS/cạnh huyền cases, P3 for extra examples. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 19 ++ TODOS.md | 17 +- VERSION | 2 +- package.json | 2 +- src/components/congruence-sss.ts | 213 +++++++++++++++++++++++ src/geom-engine/triangle.test.ts | 66 +++++++ src/geom-engine/triangle.ts | 40 +++++ src/i18n/vi.ts | 22 ++- src/pages/lop-7/tam-giac-bang-nhau.astro | 121 +++++++++++++ 9 files changed, 490 insertions(+), 12 deletions(-) create mode 100644 src/components/congruence-sss.ts create mode 100644 src/geom-engine/triangle.test.ts create mode 100644 src/geom-engine/triangle.ts create mode 100644 src/pages/lop-7/tam-giac-bang-nhau.astro diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b355b..f05e6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to **Hình Học Sống** are documented here. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: 4-digit MAJOR.MINOR.PATCH.MICRO per gstack. +## [0.0.3.0] - 2026-04-30 + +### Added + +- **Module 1 (lớp 7): Tam giác bằng nhau (SSS)** — second interactive theorem demo, live at `/lop-7/tam-giac-bang-nhau/`. + - Two side-by-side triangles ABC and A′B′C′ in a 400×300 viewBox. All 6 vertices independently draggable via Pointer Events + setPointerCapture per vertex. Drag-clamping keeps every vertex inside the canvas (16-px padding) so the triangles never escape view. + - SGK-correct encoding per autoplan Decision D3 — color and tick marks paired: AB/A′B′ in pair1 #D7263D with **1 tick**, BC/B′C′ in pair2 #1B998B with **2 ticks**, CA/C′A′ in pair3 #F46036 with **3 ticks**. Tick marks are perpendicular SVG line segments rendered at the midpoint of each side, redrawn live during drag. This is both a11y-correct (color is never the only signal) and matches what every Vietnamese textbook does. + - Live side-length readout table — six values, color-keyed to the matching tick-pair colors. + - Green pill badge "Hai tam giác bằng nhau (c.c.c)" appears whenever all 3 corresponding side pairs match within `EPSILON_LEN = 0.5` viewBox units. ARIA-live polite so screen readers announce the moment the triangles become congruent. +- `src/geom-engine/triangle.ts` — third pure module: `triangle()`, `sides()`, `congruentSSS()` with position-strict semantics (AB↔A′B′, etc., not arbitrary permutations — preserves the SGK label-correspondence convention). +- 10 new unit tests including translation invariance, similar-not-congruent rejection, EPSILON tolerance, position-strict label correspondence (permuted side-length sets are NOT counted as congruent), and symmetry of the relation. +- Hub landing page: lớp 7 card now links to the module with "Khám phá" status. + +### Notes + +- Per autoplan: rigid-motion overlay animation EXPLICITLY DROPPED from MVP (was scope creep — rotation+reflection interpolation = days, not hours). The green badge + tick-mark color match is the entire success state. +- SAS / ASA / AAS / cạnh huyền-góc nhọn / cạnh huyền-cạnh góc vuông toggles deferred — SSS alone validates the canvas + tick-mark + badge pattern. Other cases land in v0.0.5.0+ as toggles on the same canvas. +- Worked examples count: 1 (autoplan called for 3). Same posture as Module 3 — content additions don't gate the killer-demo ship. + ## [0.0.2.0] - 2026-04-29 ### Added diff --git a/TODOS.md b/TODOS.md index 429f189..e1caf21 100644 --- a/TODOS.md +++ b/TODOS.md @@ -57,16 +57,15 @@ Tracked work, organized by component then priority (P0 highest → P4 lowest). S **Priority:** P3 **What:** Currently uses Unicode (∠AMB, °) which renders fine in Be Vietnam Pro. Switch to KaTeX when notation gets richer (cung, đường tròn (O), etc.). -## Module 1 — Lớp 7 Tam giác bằng nhau (weekend 3) +## Module 1 — Lớp 7 Tam giác bằng nhau -- **SSS / SAS / ASA / AAS / cạnh huyền-góc nhọn / cạnh huyền-cạnh góc vuông detectors** - **Priority:** P1 - **What:** Pure geometry functions in `src/geom-engine/congruence.ts`. Use `EPSILON_LEN = 0.5`. Color-pair highlighting + green "Hai tam giác bằng nhau" badge. - **Note:** Rigid-motion overlay animation EXPLICITLY DROPPED per autoplan (was scope creep). +- **SAS / ASA / AAS / cạnh huyền-góc nhọn / cạnh huyền-cạnh góc vuông toggles** + **Priority:** P2 + **What:** SSS shipped in v0.0.3.0. Add the other 5 cases as toggles on the same canvas — toggling switches which sides/angles get the matched encoding and which detector runs. -- **SGK tick-mark encoding** - **Priority:** P1 - **What:** 1/2/3 ticks for matching sides, 1/2/3 arcs for matching angles. Always paired with the 3-color palette (#D7263D / #1B998B / #F46036). Per Design Decision D3 — single largest a11y + pedagogical unlock. +- **More worked examples (Module 1)** + **Priority:** P3 + **What:** v0.0.3.0 ships 1 example. SGK textbook has many. Add 2 more. ## Module 2 — Lớp 8 Tam giác đồng dạng (weekend 4) @@ -151,3 +150,5 @@ Tracked work, organized by component then priority (P0 highest → P4 lowest). S - **Drag M around circle, project to circle constraint** — `src/components/inscribed-angle.ts` + `src/geom-engine/circle.ts:projectToCircle`. **Completed:** v0.0.2.0 (2026-04-29) - **TheoremCanvas primitive first cut** — vanilla TS in Astro `