r" class="visualizer-container"></div>
        <div id="example4-container" class="visualizer-container"></div>

    </div>

    <script>
        // --- Point Utility Functions (Global) ---
        function createPoint(x = 0, y = 0) { return { x, y }; }
        function addPoints(p1, p2) { return { x: p1.x + p2.x, y: p1.y + p2.y }; }
        function scalePoint(p, scalar) { return { x: p.x * scalar, y: p.y * scalar }; }
        function distancePoints(p1, p2) {
            const dx = p1.x - p2.x; const dy =