<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3%2F06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95</id>
	<title>06-数学相关/06-计算几何 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3%2F06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95"/>
	<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;action=history"/>
	<updated>2026-05-20T22:20:33Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=371&amp;oldid=prev</id>
		<title>33DAI：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=371&amp;oldid=prev"/>
		<updated>2026-05-20T18:12:11Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff:1.41:old-370:rev-371 --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=370&amp;oldid=prev</id>
		<title>-&gt;Importer：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=370&amp;oldid=prev"/>
		<updated>2026-05-20T16:50:33Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 16:50的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff:1.41:old-271:rev-370 --&gt;
&lt;/table&gt;</summary>
		<author><name>-&gt;Importer</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=271&amp;oldid=prev</id>
		<title>33DAI：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=271&amp;oldid=prev"/>
		<updated>2026-05-20T16:25:42Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 16:25的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff:1.41:old-270:rev-271 --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=270&amp;oldid=prev</id>
		<title>-&gt;Importer：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=06-%E6%95%B0%E5%AD%A6%E7%9B%B8%E5%85%B3/06-%E8%AE%A1%E7%AE%97%E5%87%A0%E4%BD%95&amp;diff=270&amp;oldid=prev"/>
		<updated>2026-05-20T16:22:29Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== 欧几里得距离 ==&lt;br /&gt;
&lt;br /&gt;
- &amp;lt;math&amp;gt;(x_1,y_1)&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;(x_2,y_2)&amp;lt;/math&amp;gt; 的距离为 &amp;lt;math&amp;gt;\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
- &amp;lt;math&amp;gt;(x_1,y_1,z_1)&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;(x_2,y_2,z_2)&amp;lt;/math&amp;gt; 的距离为 &amp;lt;math&amp;gt;\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 海伦公式 ==&lt;br /&gt;
&lt;br /&gt;
三角形三边长分别为 &amp;lt;math&amp;gt;a,b,c&amp;lt;/math&amp;gt;，定义半周长 &amp;lt;math&amp;gt;p=\frac{a+b+c}{2}&amp;lt;/math&amp;gt;，则三角形面积为：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;S=\sqrt{p(p-a)(p-b)(p-c)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 向量叉乘 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\vec{a}=(a_x,a_y),\ \vec{b}=(b_x,b_y)&lt;br /&gt;
\quad\Rightarrow\quad&lt;br /&gt;
\vec{a} \times \vec{b} = a_x b_y - a_y b_x&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
意义：&lt;br /&gt;
&lt;br /&gt;
- 结果的绝对值恰好为两向量为邻边的平行四边形面积，可以用来计算三角形面积&lt;br /&gt;
- 可以利用正负值判断两个向量的位置关系&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// 传入两个点，返回对应向量（第一个点指向第二个点）&lt;br /&gt;
pair&amp;lt;double, double&amp;gt; getV(pair&amp;lt;double, double&amp;gt; a, pair&amp;lt;double, double&amp;gt; b)&lt;br /&gt;
{&lt;br /&gt;
    return {b.first - a.first, b.second - a.second};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// 传入两个向量，返回叉乘结果&lt;br /&gt;
// 如果结果为正，第二个向量偏左，否则偏右&lt;br /&gt;
double getMul(pair&amp;lt;double, double&amp;gt; a, pair&amp;lt;double, double&amp;gt; b)&lt;br /&gt;
{&lt;br /&gt;
    return a.first * b.second - a.second * b.first;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 三角形面积 ===&lt;br /&gt;
&lt;br /&gt;
三角形 &amp;lt;math&amp;gt;ABC&amp;lt;/math&amp;gt; 的面积：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;S=\frac{1}{2}|\vec{AB}\times \vec{AC}|&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 线段相交判断 ==&lt;br /&gt;
&lt;br /&gt;
对于四个点 &amp;lt;math&amp;gt;A,B,C,D&amp;lt;/math&amp;gt;，判断线段 &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; 与线段 &amp;lt;math&amp;gt;CD&amp;lt;/math&amp;gt; 是否相交。&lt;br /&gt;
&lt;br /&gt;
通过计算 &amp;lt;math&amp;gt;\vec{AB}\times \vec{AC}&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\vec{AB}\times \vec{AD}&amp;lt;/math&amp;gt;，如果结果一正一负，则 &amp;lt;math&amp;gt;C,D&amp;lt;/math&amp;gt; 两点处于直线 &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; 的两边。同理判断 &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; 是否在直线 &amp;lt;math&amp;gt;CD&amp;lt;/math&amp;gt; 的两边。如果两个条件都满足，则两线段相交。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
bool checkX(pair&amp;lt;double, double&amp;gt; a, pair&amp;lt;double, double&amp;gt; b,&lt;br /&gt;
            pair&amp;lt;double, double&amp;gt; c, pair&amp;lt;double, double&amp;gt; d)&lt;br /&gt;
{&lt;br /&gt;
    double x, y;&lt;br /&gt;
    // c,d 是否在直线 ab 的两边&lt;br /&gt;
    auto AB = getV(a, b);&lt;br /&gt;
    auto AC = getV(a, c);&lt;br /&gt;
    auto AD = getV(a, d);&lt;br /&gt;
    x = getMul(AB, AC);&lt;br /&gt;
    y = getMul(AB, AD);&lt;br /&gt;
    if (x &amp;gt; 0 &amp;amp;&amp;amp; y &amp;gt; 0 || x &amp;lt; 0 &amp;amp;&amp;amp; y &amp;lt; 0) // c,d 在 ab 同一侧&lt;br /&gt;
        return false;&lt;br /&gt;
    // a,b 是否在直线 cd 的两边&lt;br /&gt;
    auto CD = getV(c, d);&lt;br /&gt;
    auto CA = getV(c, a);&lt;br /&gt;
    auto CB = getV(c, b);&lt;br /&gt;
    x = getMul(CD, CA);&lt;br /&gt;
    y = getMul(CD, CB);&lt;br /&gt;
    if (x * y &amp;gt; 0)&lt;br /&gt;
        return false;&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 常用几何模板速记 ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 功能 !! 公式/方法&lt;br /&gt;
|-&lt;br /&gt;
| 两点距离&lt;br /&gt;
| &amp;lt;math&amp;gt;\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 叉乘&lt;br /&gt;
| &amp;lt;math&amp;gt;a_x b_y - a_y b_x&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 点积&lt;br /&gt;
| &amp;lt;math&amp;gt;a_x b_x + a_y b_y&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 三角形面积&lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{1}{2}&lt;br /&gt;
| \vec{AB}\times \vec{AC}&lt;br /&gt;
| &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 向量夹角余弦&lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{\vec{u}\cdot\vec{v}}{&lt;br /&gt;
| \vec{u}&lt;br /&gt;
| &lt;br /&gt;
| \vec{v}&lt;br /&gt;
| }&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:数学相关]]&lt;br /&gt;
[[Category:三三文档]]&lt;/div&gt;</summary>
		<author><name>-&gt;Importer</name></author>
	</entry>
</feed>