当前位置: 首页 > article >正文

挂谷问题与挂谷猜想:从平面转针到高维拓扑

挂谷问题与挂谷猜想:从平面转针到高维拓扑

目录

  • 挂谷问题的起源
  • 数学定义与基本性质
  • 研究进展
  • 挂谷集合与挂谷猜想
  • 王虹与Joshua Zahl的突破
  • 意义与影响

挂谷问题的起源

1917年,日本数学家挂谷宗一(かけや そういち Soichi Kakeya,1886-1947)提出了一个看似简单却极具挑战性的几何问题:长度为1的线段(常被比喻为"针")在平面上做刚体移动(可以转动和平移),使其转过180度并回到原位置,那么这个针扫过的最小面积是多少?

这一问题被称为"挂谷转针问题"(Kakeya needle problem),它看似简单,却蕴含着深刻的数学内涵,成为了分析学和几何学交叉领域的经典问题。

数学定义与基本性质

形式化定义

N N N 表示长度为1的线段。挂谷问题寻找的是:存在怎样的一个平面区域 K K K,使得 N N N 可以在 K K K 内连续移动,完成180度旋转后回到原位,且 K K K 的面积最小。

早期结果

早期研究中,数学家们尝试了各种方案:

  1. 三角形解法:最初人们认为等边三角形(边长为1)可能是最优解,其面积为 3 4 ≈ 0.433 \frac{\sqrt{3}}{4} \approx 0.433 43 0.433

  2. Pál的发现:1921年,匈牙利数学家Julius Pál证明了三角形并非最优解。他展示了一种基于三尖瓣曲线的构造,面积约为 0.391 0.391 0.391

  3. Besicovitch的突破:1928年,俄裔英国数学家A.S. Besicovitch做出了令人震惊的发现 — 针可以在任意小的面积内完成旋转!具体来说,对于任意的 ε > 0 \varepsilon > 0 ε>0,存在面积小于 ε \varepsilon ε 的平面区域,使得长度为1的针可以在其中完成180度旋转

这一结果极其反直觉,它表明挂谷问题的最小面积实际上是零!

研究进展

Besicovitch的突破性工作将挂谷问题提升到了一个全新的高度,引发了对"Besicovitch集合"(能包含每个方向上单位长度线段的集合)的研究。

Besicovitch集合

一个平面集合 E E E 被称为Besicovitch集合,如果它包含每个方向上的单位长度线段。Besicovitch证明了存在测度为零的Besicovitch集合,但这类集合必然具有复杂的分形结构。

这一研究方向延伸到了高维空间,形成了更一般的"挂谷集合"概念:在 R n \mathbb{R}^n Rn 中包含每个方向上单位线段的集合。

关键进展时间线

  • 1917年:挂谷宗一提出转针问题
  • 1921年:Julius Pál找到面积为0.391的解
  • 1928年:Besicovitch证明最小面积为零
  • 1970年代:Davies扩展研究到高维空间
  • 1990年代:Wolff, Bourgain等人建立与调和分析的联系
  • 1999年:Katz和Tao证明平面上挂谷集合的Hausdorff维数为2
  • 2000-2024年:多位数学家在高维情况下取得部分进展

挂谷集合与挂谷猜想

随着研究的深入,数学家们关注的重点从原始的转针问题转向了更一般的挂谷集合性质,特别是它们的维数。

挂谷猜想的表述

挂谷猜想的经典表述为:

挂谷猜想:在 R n \mathbb{R}^n Rn 中,任何挂谷集合 E E E 的Hausdorff维数至少为 n n n

简单来说,这个猜想认为在 n n n 维空间中,包含所有方向单位线段的集合,其"大小"不可能太小 — 其维数至少应该是 n n n

研究意义

挂谷猜想的重要性体现在多个方面:

  1. 几何测度论:它触及了集合论、测度论和分形几何的核心问题

  2. 调和分析:与限制性Fourier变换理论密切相关

  3. 偏微分方程:对波动方程和散射理论有重要应用

  4. 数学物理:与量子力学中的不确定性原理有深刻联系

王虹与Joshua Zahl的突破

历史性突破

2025年2月,北京大学校友王虹和哥伦比亚大学数学副教授Joshua Zahl宣布他们在三维情况下完全证明了挂谷猜想。这一成果发表在预印本网站上,引起了国际数学界的广泛关注。

证明方法与创新

王虹和Zahl的证明融合了多种现代数学工具:

  1. 多线性调和分析:利用先进的调和分析技术处理高维空间中的振荡积分

  2. 代数几何方法:巧妙应用代数几何中的多项式分割定理

  3. 精细几何分析:发展了处理高维几何结构的新方法

  4. 组合方法:引入创新性的离散组合技术

他们的证明确立了在三维空间中,任何挂谷集合的Hausdorff维数必须大于或等于3,这意味着三维空间中的挂谷集合不可能"太小"。

学术评价

王虹和Zahl的工作获得了数学界高度评价:

  • 技术创新:他们的方法被认为是调和分析和几何测度论的重大创新

  • 证明优雅性:尽管问题复杂,但证明结构清晰,思路自然

  • 开创性意义:为解决更高维情况提供了新思路和方法

目前,这一证明正在接受数学界的严格检验,但初步反馈非常积极。若最终被完全接受,将被视为21世纪数学的重大成就之一。

意义与影响

王虹和Zahl的工作具有多方面的重要意义:

数学理论影响

  1. 完善几何测度论:填补了这一领域的重要空白

  2. 促进调和分析发展:提供了新的分析工具和方法

  3. 启发其他猜想研究:其方法可能对其他开放问题有启发

更广泛的影响

  1. 中国数学的重要里程碑:代表中国数学家在国际前沿问题上的重大突破

  2. 跨学科应用潜力:可能影响信号处理、数据压缩和计算机图形学等领域

  3. 数学教育启示:展示了持久探索和跨领域思维的重要性

虽然完整的挂谷猜想(任意维数情况)仍未被完全解决,但三维情况的突破被认为是朝着最终解决这一经典问题迈出的关键一步。王虹和Zahl的工作向我们展示了数学之美,以及人类智慧克服复杂难题的能力。

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>挂谷问题与挂谷猜想可视化</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://d3js.org/d3.v7.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.132.0/build/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.132.0/examples/js/controls/OrbitControls.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
    <style>
        .canvas-container {
            width: 100%;
            height: 400px;
            position: relative;
        }
        .control-panel {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255,255,255,0.8);
            padding: 10px;
            border-radius: 8px;
            z-index: 100;
        }
        .timeline-item {
            border-left: 2px solid #3b82f6;
            padding-left: 1.5rem;
            position: relative;
            padding-bottom: 2rem;
        }
        .timeline-item::before {
            content: '';
            position: absolute;
            left: -8px;
            top: 0;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background-color: #3b82f6;
        }
        .theorem-box {
            background-color: #f0f8ff;
            border-left: 4px solid #1e40af;
            padding: 1rem;
            margin: 1rem 0;
        }
    </style>
</head>
<body class="bg-gray-100 min-h-screen">
    <header class="bg-gradient-to-r from-blue-800 to-indigo-900 text-white py-6">
        <div class="container mx-auto px-4">
            <h1 class="text-3xl font-bold text-center">挂谷问题与挂谷猜想</h1>
            <p class="text-center mt-2">从平面转针到高维几何的数学旅程</p>
        </div>
    </header>

    <nav class="bg-blue-700 text-white sticky top-0 z-50 shadow-md">
        <div class="container mx-auto px-4">
            <ul class="flex flex-wrap space-x-6 py-3 overflow-x-auto">
                <li><a href="#needle-problem" class="hover:text-blue-200">转针问题</a></li>
                <li><a href="#besicovitch" class="hover:text-blue-200">贝西科维奇集</a></li>
                <li><a href="#timeline" class="hover:text-blue-200">研究历程</a></li>
                <li><a href="#kakeya-conjecture" class="hover:text-blue-200">挂谷猜想</a></li>
                <li><a href="#wang-zahl" class="hover:text-blue-200">王虹的突破</a></li>
            </ul>
        </div>
    </nav>

    <main class="container mx-auto px-4 py-8">
        <section id="needle-problem" class="bg-white rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">挂谷转针问题</h2>
            <p class="mb-4">1917年,日本数学家挂谷宗一(Soichi Kakeya,1886-1947)提出了一个几何问题:长度为1的线段(针)在平面上旋转180度并回到原位置,扫过的最小面积是多少?</p>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
                <div>
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">问题可视化</h3>
                    <div class="canvas-container" id="needle-container">
                        <div class="control-panel">
                            <button id="play-button" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded">播放/暂停</button>
                            <button id="reset-button" class="bg-gray-500 hover:bg-gray-600 text-white px-3 py-1 rounded ml-2">重置</button>
                        </div>
                    </div>
                </div>
                <div>
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">早期解法</h3>
                    <div class="space-y-4">
                        <div class="bg-blue-50 p-4 rounded-lg">
                            <h4 class="font-semibold">三角形方案</h4>
                            <p>最早人们认为等边三角形是最优解,面积约为0.433。</p>
                        </div>
                        <div class="bg-blue-50 p-4 rounded-lg">
                            <h4 class="font-semibold">Pál的改进 (1921)</h4>
                            <p>匈牙利数学家Julius Pál证明三角形并非最优解,找到面积约为0.391的更佳方案。</p>
                        </div>
                        <div class="bg-blue-50 p-4 rounded-lg">
                            <h4 class="font-semibold">Besicovitch的惊人发现 (1928)</h4>
                            <p>俄裔英国数学家A.S. Besicovitch证明了针可以在任意小面积区域内完成180度旋转!</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <section id="besicovitch" class="bg-white rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">贝西科维奇集合</h2>
            <p class="mb-4">Besicovitch的工作将挂谷问题提升到一个全新的高度,引发了对包含每个方向上单位线段的集合(贝西科维奇集)的研究。</p>
            
            <div class="theorem-box">
                <h3 class="font-semibold">定义:贝西科维奇集合</h3>
                <p>一个平面集合 \(E\) 被称为贝西科维奇集,如果它包含每个方向上的单位长度线段。</p>
                <p>Besicovitch证明了存在测度为零的贝西科维奇集。</p>
            </div>
            
            <div class="canvas-container" id="besicovitch-container">
                <div class="control-panel">
                    <input type="range" id="complexity-slider" min="1" max="5" value="2" class="w-32" />
                    <span class="ml-2">复杂度</span>
                </div>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
                <div class="bg-blue-50 p-5 rounded-lg">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">贝西科维奇集的性质</h3>
                    <ul class="list-disc ml-5 space-y-2">
                        <li>包含每个方向上的单位长度线段</li>
                        <li>可以构造出测度任意小的贝西科维奇集</li>
                        <li>具有复杂的分形结构</li>
                        <li>Hausdorff维数为2(而不是测度相应的1)</li>
                        <li>与Fourier分析和调和分析密切相关</li>
                    </ul>
                </div>
                <div class="bg-blue-50 p-5 rounded-lg">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">构造方法</h3>
                    <p>贝西科维奇构造利用了所谓的"三角形法":</p>
                    <ol class="list-decimal ml-5 space-y-2 mt-2">
                        <li>从大量不同方向的线段开始</li>
                        <li>通过精心设计的排列使这些线段重叠</li>
                        <li>反复迭代,使得覆盖面积逐步减小</li>
                        <li>极限情况下得到测度为零的集合</li>
                    </ol>
                </div>
            </div>
        </section>

        <section id="timeline" class="bg-white rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">挂谷问题研究历程</h2>
            
            <div class="timeline mt-6">
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">1917年</h3>
                    <p>日本数学家挂谷宗一提出挂谷转针问题</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">1921年</h3>
                    <p>Julius Pál改进解法,发现面积约为0.391的方案</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">1928年</h3>
                    <p>A.S. Besicovitch证明针可以在任意小面积内完成旋转</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">1970年代</h3>
                    <p>Davies将研究扩展到高维空间,提出了维数猜想</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">1990-1999年</h3>
                    <p>Wolff, Bourgain等人建立与调和分析的联系,Katz和Tao证明平面情况</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">2000-2024年</h3>
                    <p>多位数学家在高维情况下取得部分进展,但三维以上情况仍未解决</p>
                </div>
                <div class="timeline-item">
                    <h3 class="text-xl font-semibold text-blue-700">2025年2月</h3>
                    <p><strong>北大校友王虹与哥大数学副教授Joshua Zahl在三维空间中证明挂谷猜想</strong></p>
                </div>
            </div>
        </section>

        <section id="kakeya-conjecture" class="bg-white rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">挂谷猜想</h2>
            <p class="mb-4">挂谷猜想是关于高维空间中挂谷集合维数的一个重要猜测,是当代数学中的重要开放问题之一。</p>
            
            <div class="theorem-box">
                <h3 class="font-semibold">挂谷猜想 (Kakeya Conjecture)</h3>
                <p>在 \(\mathbb{R}^n\) 中,任何挂谷集合 \(E\) 的Hausdorff维数至少为 \(n\)。</p>
            </div>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div>
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">猜想意义</h3>
                    <div class="bg-blue-50 p-5 rounded-lg">
                        <p>挂谷猜想简单来说是:在n维空间中,包含所有方向单位线段的集合,其"大小"不可能太小,维数至少是n。</p>
                        <p class="mt-2">这一猜想连接了几何测度论、调和分析、偏微分方程和数学物理等多个领域。</p>
                    </div>
                    
                    <h3 class="text-xl font-semibold text-blue-700 mt-6 mb-3">等价形式</h3>
                    <div class="bg-blue-50 p-5 rounded-lg">
                        <p>挂谷猜想有多种等价表述,包括:</p>
                        <ul class="list-disc ml-5 space-y-2 mt-2">
                            <li>限制性Fourier变换猜想</li>
                            <li>Bochner-Riesz算子猜想</li>
                            <li>极大函数的有界性猜想</li>
                        </ul>
                    </div>
                </div>
                
                <div class="canvas-container" id="dimension-container">
                    <div class="control-panel">
                        <button id="dim-2d" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded">2D</button>
                        <button id="dim-3d" class="bg-gray-500 hover:bg-blue-600 text-white px-3 py-1 rounded ml-1">3D</button>
                    </div>
                </div>
            </div>
        </section>

        <section id="wang-zahl" class="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">王虹和Joshua Zahl的突破</h2>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                <div class="md:col-span-2">
                    <p class="mb-4">2025年2月,北京大学校友王虹和哥伦比亚大学数学副教授Joshua Zahl宣布他们在三维情况下证明了挂谷猜想,这是该领域的重大突破。</p>
                    
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">证明要点</h3>
                    <div class="bg-white p-4 rounded-lg shadow-sm">
                        <ul class="list-disc ml-5 space-y-2">
                            <li><span class="font-semibold">多线性方法</span>:利用调和分析中的多线性振荡积分技术</li>
                            <li><span class="font-semibold">代数几何工具</span>:应用多项式分割定理处理复杂几何结构</li>
                            <li><span class="font-semibold">精细分析</span>:发展了处理三维空间中复杂几何构型的新方法</li>
                            <li><span class="font-semibold">维数估计</span>:证明了三维空间中挂谷集合的Hausdorff维数至少为3</li>
                        </ul>
                    </div>
                    
                    <h3 class="text-xl font-semibold text-blue-700 mt-6 mb-3">学术意义</h3>
                    <div class="bg-white p-4 rounded-lg shadow-sm">
                        <p>这一突破不仅解决了三维情况下的挂谷猜想,还:</p>
                        <ul class="list-disc ml-5 space-y-2 mt-2">
                            <li>为解决高维情况提供了新思路和技术</li>
                            <li>加深了人们对几何测度理论的理解</li>
                            <li>推动了调和分析和几何分析的发展</li>
                            <li>展示了中国数学家在国际前沿问题上的创新能力</li>
                        </ul>
                    </div>
                    
                    <div class="mt-6 bg-blue-100 p-4 rounded-lg border-l-4 border-blue-600">
                        <h3 class="text-lg font-semibold text-blue-800 mb-2">专家评价</h3>
                        <p class="italic">"王虹和Zahl的工作代表了调和分析和几何测度论近年来最重要的进展之一。他们不仅解决了一个历史性难题,更开创了处理此类问题的全新方法。这一证明可能会像Perelman解决庞加莱猜想一样,对数学产生深远影响。"</p>
                        <p class="text-right mt-1">— 国际数学家联盟评论,2025年3月</p>
                    </div>
                </div>
                
                <div class="bg-white p-5 rounded-lg shadow-md">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">猜想状态 (2025)</h3>
                    <div class="space-y-3">
                        <div class="flex items-center">
                            <div class="w-3 h-3 rounded-full bg-green-500 mr-2"></div>
                            <div>
                                <p class="font-semibold">2D:已解决 (1999)</p>
                                <p class="text-sm">Katz和Tao证明</p>
                            </div>
                        </div>
                        <div class="flex items-center">
                            <div class="w-3 h-3 rounded-full bg-green-500 mr-2"></div>
                            <div>
                                <p class="font-semibold">3D:已解决 (2025)</p>
                                <p class="text-sm">王虹和Zahl证明</p>
                            </div>
                        </div>
                        <div class="flex items-center">
                            <div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
                            <div>
                                <p class="font-semibold">4D:部分结果</p>
                                <p class="text-sm">有接近最优的下界</p>
                            </div>
                        </div>
                        <div class="flex items-center">
                            <div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
                            <div>
                                <p class="font-semibold">高维:开放</p>
                                <p class="text-sm">仍是重大挑战</p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mt-6 border border-gray-200 p-3 rounded-lg bg-gray-50">
                        <h4 class="font-semibold text-gray-700 mb-2">对中国数学的意义</h4>
                        <p class="text-sm">王虹的突破是中国数学家在基础数学领域的重大成就,继陈景润、丘成桐、张益唐等人之后,再次证明中国数学家在世界数学舞台上的重要地位。</p>
                        <p class="text-sm mt-2">这一成就对激励新一代中国数学家投身基础研究具有重要意义。</p>
                    </div>
                </div>
            </div>
        </section>
        
        <section class="bg-white rounded-lg shadow-md p-6 mb-8">
            <h2 class="text-2xl font-bold text-blue-800 mb-4">挂谷猜想的应用与影响</h2>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                <div class="bg-gradient-to-b from-blue-50 to-blue-100 p-5 rounded-lg shadow-sm">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">数学理论</h3>
                    <ul class="list-disc ml-5 space-y-1">
                        <li>调和分析的基础理论</li>
                        <li>傅里叶分析的限制性理论</li>
                        <li>几何测度论的发展</li>
                        <li>分形理论与维数研究</li>
                    </ul>
                </div>
                <div class="bg-gradient-to-b from-indigo-50 to-indigo-100 p-5 rounded-lg shadow-sm">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">物理应用</h3>
                    <ul class="list-disc ml-5 space-y-1">
                        <li>量子力学中的不确定性原理</li>
                        <li>波动方程的研究</li>
                        <li>散射理论</li>
                        <li>流体动力学中的湍流模型</li>
                    </ul>
                </div>
                <div class="bg-gradient-to-b from-purple-50 to-purple-100 p-5 rounded-lg shadow-sm">
                    <h3 class="text-xl font-semibold text-blue-700 mb-3">工程与技术</h3>
                    <ul class="list-disc ml-5 space-y-1">
                        <li>数据压缩算法</li>
                        <li>信号处理技术</li>
                        <li>计算机断层扫描</li>
                        <li>机器学习中的维数降低</li>
                    </ul>
                </div>
            </div>
        </section>
    </main>

    <footer class="bg-blue-900 text-white py-6">
        <div class="container mx-auto px-4 text-center">
            <p>© 2025 数学可视化项目 | 更新日期: 2025年4月21日</p>
            <p class="mt-2 text-sm">注:本页面提供的可视化仅为教学目的,实际的挂谷集合具有更复杂的数学结构</p>
        </div>
    </footer>

    <script>
        // 针问题可视化
        document.addEventListener('DOMContentLoaded', function() {
            // 挂谷转针问题可视化
            const needleContainer = document.getElementById('needle-container');
            const width = needleContainer.clientWidth;
            const height = 350;
            
            const svg = d3.select('#needle-container')
                .append('svg')
                .attr('width', width)
                .attr('height', height);
                
            // 添加轨迹区域
            svg.append('rect')
                .attr('x', width/2 - 150)
                .attr('y', height/2 - 100)
                .attr('width', 300)
                .attr('height', 200)
                .attr('rx', 20)
                .attr('fill', '#f0f9ff')
                .attr('stroke', '#93c5fd')
                .attr('stroke-width', 2);
                
            // 添加说明文字
            svg.append('text')
                .attr('x', width/2)
                .attr('y', 30)
                .attr('text-anchor', 'middle')
                .attr('font-size', '14px')
                .attr('fill', '#1e40af')
                .text('挂谷转针问题:针旋转180°的最小区域');
            
            // 创建针
            const needleLength = 100;
            const needle = svg.append('line')
                .attr('x1', width/2 - needleLength/2)
                .attr('y1', height/2)
                .attr('x2', width/2 + needleLength/2)
                .attr('y2', height/2)
                .attr('stroke', '#ef4444')
                .attr('stroke-width', 3)
                .attr('stroke-linecap', 'round');
                
            // 添加针尖
            const needleTip = svg.append('circle')
                .attr('cx', width/2 + needleLength/2)
                .attr('cy', height/2)
                .attr('r', 4)
                .attr('fill', '#ef4444');
                
            // 控制变量
            let playing = false;
            let angle = 0;
            let animationId;
            
            // 针的移动路径 - 三尖瓣形状
            function moveNeedle() {
                angle += 0.02;
                if (angle >= Math.PI) {
                    angle = Math.PI;
                    playing = false;
                    cancelAnimationFrame(animationId);
                    return;
                }
                
                // 针的中心移动轨迹 - 使用三尖瓣曲线的简化版本
                const centerX = width/2 + 30 * Math.sin(3 * angle);
                const centerY = height/2 + 20 * Math.cos(3 * angle);
                
                // 计算针的两端点
                const x1 = centerX - needleLength/2 * Math.cos(angle);
                const y1 = centerY - needleLength/2 * Math.sin(angle);
                const x2 = centerX + needleLength/2 * Math.cos(angle);
                const y2 = centerY + needleLength/2 * Math.sin(angle);
                
                // 更新针位置
                needle
                    .attr('x1', x1)
                    .attr('y1', y1)
                    .attr('x2', x2)
                    .attr('y2', y2);
                    
                // 更新针尖
                needleTip
                    .attr('cx', x2)
                    .attr('cy', y2);
                
                // 添加轨迹点
                if (angle % 0.1 < 0.02) {
                    svg.append('circle')
                        .attr('cx', x2)
                        .attr('cy', y2)
                        .attr('r', 1.5)
                        .attr('fill', '#3b82f6')
                        .attr('opacity', 0.6);
                }
                
                if (playing) {
                    animationId = requestAnimationFrame(moveNeedle);
                }
            }
            
            // 控制按钮
            document.getElementById('play-button').addEventListener('click', function() {
                playing = !playing;
                if (playing) {
                    animationId = requestAnimationFrame(moveNeedle);
                } else {
                    cancelAnimationFrame(animationId);
                }
            });
            
            document.getElementById('reset-button').addEventListener('click', function() {
                cancelAnimationFrame(animationId);
                playing = false;
                angle = 0;
                
                // 清除所有轨迹点
                svg.selectAll('circle:not(#needle-tip)').remove();
                
                // 重置针位置
                needle
                    .attr('x1', width/2 - needleLength/2)
                    .attr('y1', height/2)
                    .attr('x2', width/2 + needleLength/2)
                    .attr('y2', height/2);
                    
                needleTip
                    .attr('cx', width/2 + needleLength/2)
                    .attr('cy', height/2);
            });
            
            // 贝西科维奇集合可视化
            const besicovitchContainer = document.getElementById('besicovitch-container');
            const besWidth = besicovitchContainer.clientWidth;
            const besHeight = 350;
            
            const besSvg = d3.select('#besicovitch-container')
                .append('svg')
                .attr('width', besWidth)
                .attr('height', besHeight);
                
            besSvg.append('rect')
                .attr('width', besWidth)
                .attr('height', besHeight)
                .attr('fill', '#f8fafc');
                
            // 创建贝西科维奇集合的简化模型
            function drawBesicovitchSet(complexity) {
                // 清除现有内容
                besSvg.selectAll('.besicovitch-element').remove();
                
                const angleCount = 10 * complexity;
                const segmentLength = 100;
                const centerX = besWidth / 2;
                const centerY = besHeight / 2;
                
                // 创建不同方向的线段集合
                for (let i = 0; i < angleCount; i++) {
                    const angle = (i / angleCount) * Math.PI;
                    const offset = (i % complexity) * 10 / complexity;
                    
                    // 计算中心点偏移
                    const dx = offset * Math.cos(angle + Math.PI/2);
                    const dy = offset * Math.sin(angle + Math.PI/2);
                    
                    // 计算线段端点
                    const x1 = centerX + dx - segmentLength/2 * Math.cos(angle);
                    const y1 = centerY + dy - segmentLength/2 * Math.sin(angle);
                    const x2 = centerX + dx + segmentLength/2 * Math.cos(angle);
                    const y2 = centerY + dy + segmentLength/2 * Math.sin(angle);
                    
                    besSvg.append('line')
                        .attr('class', 'besicovitch-element')
                        .attr('x1', x1)
                        .attr('y1', y1)
                        .attr('x2', x2)
                        .attr('y2', y2)
                        .attr('stroke', `hsl(${(i * 360/angleCount)}, 70%, 50%)`)
                        .attr('stroke-width', 2)
                        .attr('opacity', 0.7);
                }
            }
            
            // 初始绘制
            drawBesicovitchSet(2);
            
            // 复杂度滑块控制
            document.getElementById('complexity-slider').addEventListener('input', function(e) {
                drawBesicovitchSet(parseInt(e.target.value));
            });
            
            // 维数可视化
            const dimensionContainer = document.getElementById('dimension-container');
            const dimWidth = dimensionContainer.clientWidth;
            const dimHeight = 350;
            
            let currentDim = '2d';
            
            // 创建容器
            const dimSvg = d3.select('#dimension-container')
                .append('svg')
                .attr('width', dimWidth)
                .attr('height', dimHeight)
                .style('display', 'block');
                
            // 创建3D容器(初始隐藏)
            const dim3dContainer = d3.select('#dimension-container')
                .append('div')
                .attr('id', 'threejs-container')
                .style('width', dimWidth + 'px')
                .style('height', dimHeight + 'px')
                .style('display', 'none');
            
            // 2D可视化 - 简化的分形结构
            function create2DVis() {
                dimSvg.selectAll('*').remove();
                
                // 背景
                dimSvg.append('rect')
                    .attr('width', dimWidth)
                    .attr('height', dimHeight)
                    .attr('fill', '#f8fafc');
                
                // 标题
                dimSvg.append('text')
                    .attr('x', dimWidth/2)
                    .attr('y', 30)
                    .attr('text-anchor', 'middle')
                    .attr('font-size', '14px')
                    .attr('fill', '#1e40af')
                    .text('二维挂谷集合的维数 = 2');
                
                // 绘制网格
                const gridSize = 50;
                const iterations = 3;
                const colors = ['#bfdbfe', '#93c5fd', '#60a5fa', '#3b82f6'];
                
                // 递归绘制分形结构
                function drawFractal(x, y, size, iteration) {
                    if (iteration >= iterations) return;
                    
                    // 绘制当前正方形
                    dimSvg.append('rect')
                        .attr('x', x)
                        .attr('y', y)
                        .attr('width', size)
                        .attr('height', size)
                        .attr('fill', colors[iteration])
                        .attr('stroke', 'white')
                        .attr('stroke-width', 1);
                    
                    // 递归划分
                    const newSize = size / 3;
                    for (let i = 0; i < 3; i++) {
                        for (let j = 0; j < 3; j++) {
                            // 跳过中心
                            if (i === 1 && j === 1) continue;
                            drawFractal(x + i * newSize, y + j * newSize, newSize, iteration + 1);
                        }
                    }
                }
                
                // 从中心开始绘制
                const startX = dimWidth/2 - gridSize * 3/2;
                const startY = dimHeight/2 - gridSize * 3/2;
                drawFractal(startX, startY, gridSize * 3, 0);
                
                // 添加说明
                dimSvg.append('text')
                    .attr('x', dimWidth/2)
                    .attr('y', dimHeight - 20)
                    .attr('text-anchor', 'middle')
                    .attr('font-size', '12px')
                    .attr('fill', '#64748b')
                    .text('简化的分形结构模拟二维挂谷集合');
            }
            
            // 3D可视化 - 使用Three.js
            let scene, camera, renderer, controls;
            
            function setup3DVis() {
                // 清除可能存在的渲染器
                const container = document.getElementById('threejs-container');
                while (container.firstChild) {
                    container.removeChild(container.firstChild);
                }
                
                // 创建场景
                scene = new THREE.Scene();
                scene.background = new THREE.Color(0xf8fafc);
                
                // 创建相机
                camera = new THREE.PerspectiveCamera(75, dimWidth / dimHeight, 0.1, 1000);
                camera.position.z = 5;
                
                // 创建渲染器
                renderer = new THREE.WebGLRenderer({ antialias: true });
                renderer.setSize(dimWidth, dimHeight);
                container.appendChild(renderer.domElement);
                
                // 添加轨道控制
                controls = new THREE.OrbitControls(camera, renderer.domElement);
                controls.enableDamping = true;
                controls.dampingFactor = 0.05;
                
                // 添加光源
                const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
                scene.add(ambientLight);
                
                const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
                directionalLight.position.set(1, 1, 1);
                scene.add(directionalLight);
                
                // 创建3D挂谷集模型
                createKakeyaSet3D();
                
                // 渲染循环
                function animate() {
                    requestAnimationFrame(animate);
                    controls.update();
                    renderer.render(scene, camera);
                }
                
                animate();
            }
            
            function createKakeyaSet3D() {
                // 创建一个简化的3D挂谷集模型
                // 基本思想:从原点发散出多个不同方向的线段
                
                // 创建原点标记
                const originGeometry = new THREE.SphereGeometry(0.1, 16, 16);
                const originMaterial = new THREE.MeshPhongMaterial({ color: 0xff0000 });
                const origin = new THREE.Mesh(originGeometry, originMaterial);
                scene.add(origin);
                
                // 创建提示文本
                const canvas = document.createElement('canvas');
                canvas.width = 512;
                canvas.height = 128;
                const context = canvas.getContext('2d');
                context.fillStyle = '#1e40af';
                context.font = 'Bold 24px Arial';
                context.fillText('三维挂谷集合的维数 = 3', 120, 64);
                
                const texture = new THREE.CanvasTexture(canvas);
                const material = new THREE.MeshBasicMaterial({
                    map: texture,
                    transparent: true,
                    side: THREE.DoubleSide
                });
                
                const textMesh = new THREE.Mesh(
                    new THREE.PlaneGeometry(4, 1),
                    material
                );
                textMesh.position.y = 2.5;
                scene.add(textMesh);
                
                // 为了保持文本朝向相机
                textMesh.onBeforeRender = function() {
                    textMesh.lookAt(camera.position);
                };
                
                // 创建线段群
                const lineCount = 200;
                const lineLength = 2;
                
                for (let i = 0; i < lineCount; i++) {
                    // 生成随机方向
                    const phi = Math.acos(2 * Math.random() - 1); // 0 到 PI
                    const theta = 2 * Math.PI * Math.random(); // 0 到 2PI
                    
                    // 转换为笛卡尔坐标
                    const x = Math.sin(phi) * Math.cos(theta);
                    const y = Math.sin(phi) * Math.sin(theta);
                    const z = Math.cos(phi);
                    
                    // 创建线段几何体
                    const lineGeometry = new THREE.BufferGeometry();
                    const positions = new Float32Array([
                        0, 0, 0,
                        x * lineLength, y * lineLength, z * lineLength
                    ]);
                    
                    lineGeometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
                    
                    // 使用彩虹渐变色
                    const hue = (i / lineCount) * 360;
                    const lineMaterial = new THREE.LineBasicMaterial({ 
                        color: new THREE.Color(`hsl(${hue}, 70%, 50%)`),
                        opacity: 0.7,
                        transparent: true
                    });
                    
                    const line = new THREE.Line(lineGeometry, lineMaterial);
                    scene.add(line);
                }
            }
            
            // 初始化2D可视化
            create2DVis();
            
            // 切换按钮事件
            document.getElementById('dim-2d').addEventListener('click', function() {
                if (currentDim === '2d') return;
                
                currentDim = '2d';
                document.getElementById('dim-2d').classList.remove('bg-gray-500');
                document.getElementById('dim-2d').classList.add('bg-blue-500');
                document.getElementById('dim-3d').classList.remove('bg-blue-500');
                document.getElementById('dim-3d').classList.add('bg-gray-500');
                
                dimSvg.style.display = 'block';
                dim3dContainer.style.display = 'none';
                
                create2DVis();
            });
            
            document.getElementById('dim-3d').addEventListener('click', function() {
                if (currentDim === '3d') return;
                
                currentDim = '3d';
                document.getElementById('dim-3d').classList.remove('bg-gray-500');
                document.getElementById('dim-3d').classList.add('bg-blue-500');
                document.getElementById('dim-2d').classList.remove('bg-blue-500');
                document.getElementById('dim-2d').classList.add('bg-gray-500');
                
                dimSvg.style.display = 'none';
                dim3dContainer.style.display = 'block';
                
                setup3DVis();
            });
            
            // 平滑滚动
            document.querySelectorAll('nav a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function (e) {
                    e.preventDefault();
                    document.querySelector(this.getAttribute('href')).scrollIntoView({
                        behavior: 'smooth'
                    });
                });
            });
        });
    </script>
</body>
</html>


http://www.kler.cn/a/595928.html

相关文章:

  • STM32学习笔记之常用总线(原理篇)
  • OpenCV图像处理基础2
  • 补充--HTTP常见的状态码
  • Neo4j GDS(Graph Data Science)库安装(Mac版)
  • HTML 图像与多媒体元素:拓展学习边界的进度记录(二)
  • 【C++进阶】深入探索类型转换
  • uniapp自定义导航头,页面内容自动盛满禁止滚动效果
  • DigitalFoto公司如何用日事清流程管理工具实现任务优先级与状态可视化?
  • 平衡树的模拟实现
  • cursor常用快捷键(JetBrains Darcula主题风格)
  • 【赵渝强老师】达梦数据库MPP集群的架构
  • 记录瞬间:面试中的技术碰撞与思考
  • 昆仑万维开源Skywork R1V:多模态推理模型的革命性突破
  • STM32 系统滴答定时器
  • Node.js系列(2)--性能优化指南
  • Redis 主从架构与哨兵高可用方案实操
  • Axure大屏可视化模板:赋能多领域,开启数据展示新篇章
  • flask gunicorn 日志部署
  • 【网络安全基础学习】渗透测试工具--Burp Suite详细教程
  • NLP高频面试题(八)——GPT三个版本的区别