OSDN Git Service

Update distance.md & its image.
authorTiger3018 <31267153+Tiger3018@users.noreply.github.com>
Thu, 28 Mar 2019 15:59:07 +0000 (23:59 +0800)
committerTiger3018 <31267153+Tiger3018@users.noreply.github.com>
Thu, 28 Mar 2019 15:59:07 +0000 (23:59 +0800)
* Github : Please close #1114.
* Merged before #1113, and #1113 should be updated with new md file.

docs/geometry/distance.md [moved from docs/misc/distance.md with 79% similarity]
docs/geometry/images/distance-0.png [new file with mode: 0644]
docs/geometry/images/distance-1.png [moved from docs/misc/images/manhattan-dis.png with 100% similarity]
docs/geometry/images/distance-2.svg [new file with mode: 0644]
docs/geometry/images/distance-3.svg [new file with mode: 0644]
docs/geometry/images/distance-4.svg [new file with mode: 0644]

similarity index 79%
rename from docs/misc/distance.md
rename to docs/geometry/distance.md
index 650413e..564f25b 100644 (file)
@@ -1,6 +1,6 @@
 ## 欧氏距离
 
-在平面直角坐标系中,设点 $A,B$ 的坐标分别为 $A(x_1,y_1),B(x_2,y_2)$ ,则两点间的欧氏距离为:
+欧氏距离,一般也称作欧几里得距离。在平面直角坐标系中,设点 $A,B$ 的坐标分别为 $A(x_1,y_1),B(x_2,y_2)$ ,则两点间的欧氏距离为:
 
 $$
 \left | AB \right | = \sqrt{\left ( x_2 - x_1 \right )^2 + \left ( y_2 - y_1 \right )^2}
@@ -20,7 +20,7 @@ $$
 
 那么,三维空间中两点的欧氏距离公式呢?我们来观察下图。
 
-![https://cdn.luogu.org/upload/pic/47571.png](https://cdn.luogu.org/upload/pic/47571.png)
+![dis-3-dimensional](./images/distance-0.png)
 
 我们很容易发现,在 $\triangle ADC$ 中, $\angle ADC = 90^\circ$ ;在 $\triangle ACB$ 中, $\angle ACB = 90^\circ$ 。
 
@@ -55,7 +55,7 @@ $$
 
 ## 曼哈顿距离
 
-在二维空间内,两个点之间的曼哈顿距离为它们横坐标之差的绝对值与纵坐标之差的绝对值之和。设点 $A(x_1,y_1),B(x_2,y_2)$ ,则 $A,B$ 之间的曼哈顿距离用公式可以表示为:
+在二维空间内,两个点之间的曼哈顿距离( Manhattan distance )为它们横坐标之差的绝对值与纵坐标之差的绝对值之和。设点 $A(x_1,y_1),B(x_2,y_2)$ ,则 $A,B$ 之间的曼哈顿距离用公式可以表示为:
 
 $$
 d(A,B) = |x_1 - x_2| + |y_1 - y_2|
@@ -63,18 +63,18 @@ $$
 
 观察下图:
 
-![](./images/manhattan-dis.png)
+![manhattan-dis-diff](./images/distance-1.png)
 
 在 $A,B$ 间,黄线、橙线都表示曼哈顿距离,而红线、蓝线表示等价的曼哈顿距离,绿线表示欧氏距离。
 
 同样的栗子,在下图中 $A,B$ 的坐标分别为 $A(6,5),B(2,2)$ 。
 
-![https://cdn.luogu.org/upload/pic/47570.png](https://cdn.luogu.org/upload/pic/47570.png)
+![manhattan-dis](./images/distance-2.svg)
 
 通过公式,我们很容易得到 $A,B$ 两点间的曼哈顿距离:
 
 $$
-d(A,B) = |6 - 2| + |5 - 2| = 4 + 3 = 7
+d(A,B) = |20 - 10| + |25 - 10| = 10 + 15 = 25
 $$
 
 经过推导,我们得到 $n$ 维空间 的曼哈顿距离公式为:
@@ -98,7 +98,7 @@ $$
 
   点到自身的曼哈顿距离为 $0$ 。
 
-  $d(i,i) = 0$
+  $d(i,i) = 0$
 
 - **对称性**
 
@@ -112,9 +112,9 @@ $$
 
   $d(i,j)\leq d(i,k)+d(k,j)$
 
-**例题:[洛谷 P5098](https://www.luogu.org/problemnew/show/P5098)**
+### 例题 1
 
-**解析:**
+[洛谷 P5098](https://www.luogu.org/problemnew/show/P5098)
 
 ~~(不要被难度吓住,是假的)~~
 
@@ -124,10 +124,9 @@ $$
 
 - $(y_1 - y_2 \lt 0)\rightarrow |x_1-x_2|+|y_1-y_2|=x_1 - y_1 - (x_2 - y_2)$
 
-
 只要分别求出 $x+y, x-y$ 的最大值和最小值即能得出答案。
 
-**Code**
+### 代码实现 1
 
 ```cpp
 #include <bits/stdc++.h>
@@ -162,7 +161,7 @@ int main() {
 
 ## 切比雪夫距离
 
-切比雪夫距离是向量空间中的一种度量,二个点之间的距离定义是其各坐标数值差绝对值的最大值。—— _来源:[百度百科](https://baike.baidu.com/item/%E5%88%87%E6%AF%94%E9%9B%AA%E5%A4%AB%E8%B7%9D%E7%A6%BB)_
+切比雪夫距离( Chebyshev distance )是向量空间中的一种度量,二个点之间的距离定义是其各坐标数值差绝对值的最大值。—— *来源:[维基百科](https://zh.wikipedia.org/wiki/%E5%88%87%E6%AF%94%E9%9B%AA%E5%A4%AB%E8%B7%9D%E7%A6%BB)*
 
 在二维空间内,两个点之间的切比雪夫距离为它们横坐标之差的绝对值与纵坐标之差的绝对值的最大值。设点 $A(x_1,y_1),B(x_2,y_2)$ ,则 $A,B$ 之间的切比雪夫距离用公式可以表示为:
 
@@ -172,13 +171,13 @@ $$
 
 仍然是这个栗子,下图中 $A,B$ 的坐标分别为 $A(6,5),B(2,2)$ 。
 
-![https://cdn.luogu.org/upload/pic/47570.png](https://cdn.luogu.org/upload/pic/47570.png)
+![Chebyshev-dis](./images/distance-2.svg)
 
 $$
-d(A,B) = max(|6 - 2|, |5 - 2|)=max(4,3)=4
+d(A,B) = max(|20 - 10|, |25 - 10|) = max(10, 15) = 15
 $$
 
-$n$ 维空间 中切比雪夫距离的距离公式:
+$n$ 维空间中切比雪夫距离的距离公式:
 
 $$
 \begin{aligned}
@@ -186,27 +185,26 @@ $$
 &&=& max\begin{Bmatrix} |x_i - y_i|\end{Bmatrix}(i \in n)\end{aligned}
 $$
 
+## 曼哈顿距离与切比雪夫距离的相互转化
 
-## (拓展)曼哈顿距离与切比雪夫距离的相互转化
-
-首先,我们考虑画出平面直角坐标系上所有到原点的 曼哈顿距离 为 $1$ 的点。
+首先,我们考虑画出平面直角坐标系上所有到原点的曼哈顿距离为 $1$ 的点。
 
-通过公式,我们很容易得到方程 $|x| + |y| = 1$ 。
+通过公式,我们很容易得到方程 $|x| + |y| = 1$ 。
 
 将绝对值展开,得到 $4$ 个 一次函数 ,分别是:
 
 $$
-\begin{align}
+\begin{aligned}
 &y = x + 1  &(x \geq 0, y \geq 0) \\
 &y = -x + 1 &(x \leq 0, y \geq 0) \\
 &y = x - 1  &(x \geq 0, y \leq 0)  \\
 &y = -x - 1  &(x \leq 0, y \leq 0) \\
-\end{align}
+\end{aligned}
 $$
 
 将这 $4$ 个函数画到平面直角坐标系上,得到一个边长为 $\sqrt{2}$ 的正方形,如下图所示:
 
-![https://cdn.luogu.org/upload/pic/47624.png](https://cdn.luogu.org/upload/pic/47624.png)
+![dis-diff-square-1](./images/distance-3.svg)
 
 正方形边界上所有的点到原点的 曼哈顿距离 都是 $1$ 。
 
@@ -217,25 +215,25 @@ $$
 我们将式子展开,也同样可以得到可以得到 $4$ 条 线段,分别是:
 
 $$
-\begin{align}
+\begin{aligned}
 &y = 1&(-1\leq x \leq 1) \\
 &y = -1&(-1\leq x \leq 1) \\
 &x = 1,&(-1\leq y \leq 1) \\
 &x = -1,&(-1\leq y \leq 1) \\
-\end{align}
+\end{aligned}
 $$
 
 画到平面直角坐标系上,可以得到一个边长为 $2$ 的正方形,如下图所示:
 
-![https://cdn.luogu.org/upload/pic/47626.png](https://cdn.luogu.org/upload/pic/47626.png)
+![dis-diff-square-2](./images/distance-4.svg)
 
-正方形边界上所有的点到原点的 切比雪夫距离 都是 $1$ 。
+正方形边界上所有的点到原点的切比雪夫距离都是 $1$ 。
 
 将这两幅图对比,我们会神奇地发现:
 
-这 $2$ 个正方形是 相似图形 
+这 $2$ 个正方形是相似图形
 
-所以,曼哈顿距离 与 切比雪夫距离 之间会不会有联系呢?
+所以,曼哈顿距离与切比雪夫距离之间会不会有联系呢?
 
 接下来我们简略证明一下:
 
@@ -244,31 +242,30 @@ $$
 $A,B$ 两点的曼哈顿距离为:
 
 $$
-\begin{align}
+\begin{aligned}
 d(A,B)&=|x_1 - x_2| + |y_1 - y_2|\\
 &=\max\begin{Bmatrix} x_1 - x_2 + y_1 - y_2, x_1 - x_2 + y_2 - y_1,x_2 - x_1 + y_1 - y_2, x_2 - x_1 + y_2 - y_1\end{Bmatrix}\\
 &\text{( 把绝对值拆开,能够得到四个值,这四个值中的最大值是两个非负数之和,即曼哈顿距离 )}\\
-
 &= \max(|(x_1 + y_1) - (x_2 + y_2)|, |(x_1 - y_2) - (x_2 - y_2)|)
-\end{align}
+\end{aligned}
 $$
 
-我们很容易发现,这就是 $(x_1 + y_1,x_1 - y_1), (x_2 + y_2,x_2 - y_2)$ 两点之间的切比雪夫距离。
+我们很容易发现,这就是 $(x_1 + y_1,x_1 - y_1), (x_2 + y_2,x_2 - y_2)$ 两点之间的切比雪夫距离。
 
 所以将每一个点 $(x,y)$ 转化为 $(x + y, x - y)$ ,新坐标系下的切比雪夫距离即为原坐标系下的曼哈顿距离。
 
 同理, $A,B$ 两点的切比雪夫距离为:
 
 $$
-\begin{align}
+\begin{aligned}
 d(A,B)&=\max\begin{Bmatrix} |x_1 - x_2|,|y_1 - y_2|\end{Bmatrix}\\
 &=\max\begin{Bmatrix} \left|\dfrac{x_1 + y_1}{2}-\dfrac{x_2 + y_2}{2}\right|+\left|\dfrac{x_1 - y_1}{2}-\dfrac{x_2 - y_2}{2}\right|\end{Bmatrix}
-\end{align}
+\end{aligned}
 $$
 
-而这就是 $(\dfrac{x_1 + y_1}{2},\dfrac{x_1 - y_1}{2}), (\dfrac{x_2 + y_2}{2},\dfrac{x_2 - y_2}{2})$ 两点之间的 曼哈顿距离。
+而这就是 $(\dfrac{x_1 + y_1}{2},\dfrac{x_1 - y_1}{2}), (\dfrac{x_2 + y_2}{2},\dfrac{x_2 - y_2}{2})$ 两点之间的曼哈顿距离。
 
-所以将每一个点 $(x,y)$ 转化为 $(\dfrac{x + y}{2},\dfrac{x - y}{2})$ ,新坐标系下的 曼哈顿距离 即为原坐标系下的 切比雪夫距离。
+所以将每一个点 $(x,y)$ 转化为 $(\dfrac{x + y}{2},\dfrac{x - y}{2})$ ,新坐标系下的曼哈顿距离即为原坐标系下的切比雪夫距离。
 
 ### 结论
 
@@ -277,11 +274,11 @@ $$
 - 原坐标系中的曼哈顿距离等于新坐标系中的切比雪夫距离
 - 将一个点 $(x,y)$ 的坐标变为 $(\dfrac{x + y}{2},\dfrac{x - y}{2})$ 后,
 
-原坐标系中的切比雪夫距离等于新坐标系中的 哈顿距离
+原坐标系中的切比雪夫距离等于新坐标系中的哈顿距离
 
 碰到求切比雪夫距离或曼哈顿距离的题目时,我们往往可以相互转化来求解。两种距离在不同的题目中有不同的优缺点,应该灵活运用。
 
-### 例题
+### 例题 2
 
 [**P4648**](https://www.luogu.org/problemnew/show/P4648) >(曼哈顿距离转切比雪夫距离)
 
@@ -289,13 +286,13 @@ $$
 
 最后给出 [**P5098**](https://www.luogu.org/problemnew/show/P5098) 的第二种解法:
 
-我们考虑将题目所求的 曼哈顿距离 转化为 切比雪夫距离,即把每个点的坐标 $(x,y)$ 变为 $(x + y, x - y)$ 。
+我们考虑将题目所求的曼哈顿距离转化为切比雪夫距离,即把每个点的坐标 $(x,y)$ 变为 $(x + y, x - y)$ 。
 
 所求的答案就变为 $max_{i,j\in n}\begin{Bmatrix} max\begin{Bmatrix} |x_i - x_j|,|y_i - y_j|\end{Bmatrix}\end{Bmatrix}$
 
 现要使得横坐标之差和纵坐标之差最大,只需要预处理出 $x,y$ 的最大值和最小值即可。
 
-**Code**
+### 代码实现 2
 
 ```cpp
 #include <bits/stdc++.h>
@@ -345,6 +342,6 @@ $d(L_m) = (|x_1-x_2|^m+|y1-y2|^m)^{\frac{1}{m}}$
 
 ------
 
-å½\93ç\84¶ï¼\8cè¿\98æ\9c\89å\85¶ä»\96ç\9a\84ä¸\80äº\9bè·\9d离ï¼\8cä½\86æ\98¯å\9c¨ OI ä¸­å¹¶ä¸\8d常ç\94¨ï¼\8cæ\9c\89å\85´è¶£ç\9a\84è¯\9då\8f¯ä»¥äº\86解ä¸\80ä¸\8bã\80\82
+ä¸\8aé\9d¢è¿\99两ç§\8dè·\9d离å\9c¨ OI ä¸­å¹¶ä¸\8d常ç\94¨ï¼\8cæ\9c\89å\85´è¶£ç\9a\84è¯\9då\8f¯ä»¥æ·±å\85¥äº\86解ä¸\80ä¸\8bã\80\82
 
 部分内容搬运自[浅谈三种常见的距离算法](https://www.luogu.org/blog/xuxing/Distance-Algorithm),感谢作者 [xuxing](https://www.luogu.org/space/show?uid=32139) 的授权。
diff --git a/docs/geometry/images/distance-0.png b/docs/geometry/images/distance-0.png
new file mode 100644 (file)
index 0000000..ced06d7
Binary files /dev/null and b/docs/geometry/images/distance-0.png differ
diff --git a/docs/geometry/images/distance-2.svg b/docs/geometry/images/distance-2.svg
new file mode 100644 (file)
index 0000000..fe7ac66
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="531.49px" height="531.49px" version="1.1"
+    xmlns="http://www.w3.org/2000/svg"
+    xmlns:xlink="http://www.w3.org/1999/xlink">
+<desc>Veusz output document</desc>
+<defs>
+<clipPath id="c0">
+<path d="m0,0l531.49,0l0,531.49l-531.49,0l0,-531.49"/>
+</clipPath>
+<clipPath id="c1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</clipPath>
+</defs>
+<g stroke-linejoin="bevel" stroke-linecap="square" stroke="#000000" fill-rule="evenodd">
+<g clip-path="url(#c0)">
+<g fill="none" stroke="none" stroke-width="1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</g>
+</g>
+<g clip-path="url(#c1)">
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,493.75l464.17,0M33.98,479.25l464.17,0M33.98,464.74l464.17,0M33.98,450.24l464.17,0M33.98,435.73l464.17,0M33.98,421.23l464.17,0M33.98,406.72l464.17,0M33.98,392.22l464.17,0M33.98,377.71l464.17,0M33.98,363.21l464.17,0M33.98,348.7l464.17,0M33.98,334.2l464.17,0M33.98,319.69l464.17,0M33.98,305.18l464.17,0M33.98,290.68l464.17,0M33.98,276.17l464.17,0M33.98,261.67l464.17,0M33.98,247.16l464.17,0M33.98,232.66l464.17,0M33.98,218.15l464.17,0M33.98,203.65l464.17,0M33.98,189.14l464.17,0M33.98,174.64l464.17,0M33.98,160.13l464.17,0M33.98,145.62l464.17,0M33.98,131.12l464.17,0M33.98,116.61l464.17,0M33.98,102.11l464.17,0M33.98,87.6l464.17,0M33.98,73.1l464.17,0M33.98,58.59l464.17,0M33.98,44.09l464.17,0M33.98,29.58l464.17,0"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,435.73l464.17,0M33.98,363.21l464.17,0M33.98,290.68l464.17,0M33.98,218.15l464.17,0M33.98,145.62l464.17,0M33.98,73.1l464.17,0"/>
+</g>
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,29.58l0,464.17M48.48,29.58l0,464.17M62.99,29.58l0,464.17M77.49,29.58l0,464.17M92,29.58l0,464.17M106.5,29.58l0,464.17M121.01,29.58l0,464.17M135.51,29.58l0,464.17M150.02,29.58l0,464.17M164.52,29.58l0,464.17M179.03,29.58l0,464.17M193.53,29.58l0,464.17M208.04,29.58l0,464.17M222.55,29.58l0,464.17M237.05,29.58l0,464.17M251.56,29.58l0,464.17M266.06,29.58l0,464.17M280.57,29.58l0,464.17M295.07,29.58l0,464.17M309.58,29.58l0,464.17M324.08,29.58l0,464.17M338.59,29.58l0,464.17M353.09,29.58l0,464.17M367.6,29.58l0,464.17M382.11,29.58l0,464.17M396.61,29.58l0,464.17M411.12,29.58l0,464.17M425.62,29.58l0,464.17M440.13,29.58l0,464.17M454.63,29.58l0,464.17M469.14,29.58l0,464.17M483.64,29.58l0,464.17M498.15,29.58l0,464.17"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M92,29.58l0,464.17M164.52,29.58l0,464.17M237.05,29.58l0,464.17M309.58,29.58l0,464.17M382.11,29.58l0,464.17M454.63,29.58l0,464.17"/>
+</g>
+</g>
+<g clip-path="url(#c0)">
+<g fill="none" stroke-width="1">
+<path d="m334.81,319.81l0.9,0l0,-19.02l-0.9,0l0,19.02m7.1,-5.47c-0.05,-1.71,-0.05,-3.5,-0.05,-5.54l1.22,0c2.73,0,3.92,0.98,3.92,2.8c0,1.76,-1.24,2.74,-3.67,2.74l-1.41,0m1.41,-11.32c2.13,0,3.11,0.71,3.11,2.41c0,1.78,-1.1,2.65,-3.48,2.65l-1.1,0c0,-1.75,0,-3.42,0.05,-5.07l1.41,0m-4.79,-0.71l0,0.61l1.82,0.19c0.05,1.67,0.05,3.39,0.05,5.07l0,0.96c0,1.71,0,3.41,-0.05,5.09l-1.82,0.19l0,0.62l5.14,0c3.46,0,4.88,-1.69,4.88,-3.46c0,-1.59,-1.08,-2.85,-3.64,-3.18c2.11,-0.45,2.99,-1.66,2.99,-3.02c0,-1.83,-1.45,-3.07,-4.11,-3.07l-5.26,0m21.07,9.32l-0.42,2.37c-0.78,0.38,-1.61,0.54,-2.41,0.54c-2.78,0,-4.75,-2.1,-4.75,-5.87c0,-3.74,2.1,-5.87,4.88,-5.87c0.7,0,1.4,0.15,2.11,0.54l0.42,2.36l0.96,0l-0.07,-2.74c-1.24,-0.73,-2.48,-0.94,-3.62,-0.94c-3.69,0,-6.4,2.8,-6.4,6.66c0,3.92,2.59,6.66,6.4,6.66c1.34,0,2.6,-0.26,3.79,-0.94l0.05,-2.76l-0.94,0m3.7,8.18l0.9,0l0,-19.02l-0.9,0l0,19.02" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m460.6,232.08l0.9,0l0,-19.02l-0.9,0l0,19.02m6.7,-9.78l1.99,-6.05l2.01,6.05l-4,0m6.96,4.21l-4.11,-12.07l-0.97,0l-4.04,12.03l-1.57,0.21l0,0.62l4.2,0l0,-0.62l-1.83,-0.22l1.13,-3.44l4.49,0l1.15,3.48l-1.92,0.19l0,0.62l5.05,0l0,-0.62l-1.57,-0.17m11.3,-2.62l-0.42,2.37c-0.78,0.38,-1.61,0.54,-2.41,0.54c-2.78,0,-4.75,-2.1,-4.75,-5.87c0,-3.74,2.1,-5.87,4.88,-5.87c0.7,0,1.4,0.15,2.11,0.54l0.42,2.36l0.96,0l-0.07,-2.74c-1.24,-0.73,-2.48,-0.94,-3.62,-0.94c-3.69,0,-6.4,2.8,-6.4,6.66c0,3.92,2.59,6.66,6.4,6.66c1.34,0,2.6,-0.26,3.79,-0.94l0.05,-2.76l-0.94,0m3.7,8.18l0.9,0l0,-19.02l-0.9,0l0,19.02" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="#808080" stroke-width="0.62">
+<g transform="translate(440.59,276.75)">
+<path d="m-13.92,-13.92l27.85,0l0,27.85l-27.85,0l0,-27.85"/>
+</g>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m244.82,314.33c-0.05,-1.71,-0.05,-3.5,-0.05,-5.54l1.22,0c2.73,0,3.92,0.98,3.92,2.8c0,1.76,-1.24,2.74,-3.67,2.74l-1.41,0m1.41,-11.32c2.13,0,3.11,0.71,3.11,2.41c0,1.78,-1.1,2.65,-3.48,2.65l-1.1,0c0,-1.75,0,-3.42,0.05,-5.07l1.41,0m-4.79,-0.71l0,0.61l1.82,0.19c0.05,1.67,0.05,3.39,0.05,5.07l0,0.96c0,1.71,0,3.41,-0.05,5.09l-1.82,0.19l0,0.62l5.14,0c3.46,0,4.88,-1.69,4.88,-3.46c0,-1.59,-1.08,-2.85,-3.64,-3.18c2.11,-0.45,2.99,-1.66,2.99,-3.02c0,-1.83,-1.45,-3.07,-4.11,-3.07l-5.26,0" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m462.58,163.81l1.99,-6.05l2.01,6.05l-4,0m6.96,4.21l-4.11,-12.07l-0.97,0l-4.04,12.03l-1.57,0.21l0,0.62l4.2,0l0,-0.62l-1.83,-0.22l1.13,-3.44l4.49,0l1.15,3.48l-1.92,0.19l0,0.62l5.05,0l0,-0.62l-1.57,-0.17" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m468.97,311.62l-0.42,2.37c-0.78,0.38,-1.61,0.54,-2.41,0.54c-2.78,0,-4.75,-2.1,-4.75,-5.87c0,-3.74,2.1,-5.87,4.88,-5.87c0.7,0,1.4,0.15,2.11,0.54l0.42,2.36l0.96,0l-0.07,-2.74c-1.24,-0.73,-2.48,-0.94,-3.62,-0.94c-3.69,0,-6.4,2.8,-6.4,6.66c0,3.92,2.59,6.66,6.4,6.66c1.34,0,2.6,-0.26,3.79,-0.94l0.05,-2.76l-0.94,0" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="#000000" stroke-width="1.87">
+<g transform="matrix(0 -1 1 0 454.63 290.68)">
+<path d="M0,0l145.05,0"/>
+</g>
+<g transform="translate(237.05,290.68)">
+<path d="M0,0l217.58,0"/>
+</g>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M92,493.75l0,-464.17"/>
+<path d="M92,493.75l-3.75,0M92,479.25l-3.75,0M92,464.74l-3.75,0M92,450.24l-3.75,0M92,435.73l-3.75,0M92,421.23l-3.75,0M92,406.72l-3.75,0M92,392.22l-3.75,0M92,377.71l-3.75,0M92,363.21l-3.75,0M92,348.7l-3.75,0M92,334.2l-3.75,0M92,319.69l-3.75,0M92,305.18l-3.75,0M92,290.68l-3.75,0M92,276.17l-3.75,0M92,261.67l-3.75,0M92,247.16l-3.75,0M92,232.66l-3.75,0M92,218.15l-3.75,0M92,203.65l-3.75,0M92,189.14l-3.75,0M92,174.64l-3.75,0M92,160.13l-3.75,0M92,145.62l-3.75,0M92,131.12l-3.75,0M92,116.61l-3.75,0M92,102.11l-3.75,0M92,87.6l-3.75,0M92,73.1l-3.75,0M92,58.59l-3.75,0M92,44.09l-3.75,0M92,29.58l-3.75,0"/>
+<path d="M92,435.73l-7.5,0M92,363.21l-7.5,0M92,290.68l-7.5,0M92,218.15l-7.5,0M92,145.62l-7.5,0M92,73.1l-7.5,0"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m72.54,435.94c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m73.07,358.44l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m66.47,296.49c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33m6.07,-5.6c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m66.47,223.96c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33m6.59,-10.57l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m62.9,151.01c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0m9.64,-5.17c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m62.9,78.48c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0m10.16,-10.15l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M33.98,435.73l464.17,0"/>
+<path d="M33.98,435.73l0,-3.75M48.48,435.73l0,-3.75M62.99,435.73l0,-3.75M77.49,435.73l0,-3.75M92,435.73l0,-3.75M106.5,435.73l0,-3.75M121.01,435.73l0,-3.75M135.51,435.73l0,-3.75M150.02,435.73l0,-3.75M164.52,435.73l0,-3.75M179.03,435.73l0,-3.75M193.53,435.73l0,-3.75M208.04,435.73l0,-3.75M222.55,435.73l0,-3.75M237.05,435.73l0,-3.75M251.56,435.73l0,-3.75M266.06,435.73l0,-3.75M280.57,435.73l0,-3.75M295.07,435.73l0,-3.75M309.58,435.73l0,-3.75M324.08,435.73l0,-3.75M338.59,435.73l0,-3.75M353.09,435.73l0,-3.75M367.6,435.73l0,-3.75M382.11,435.73l0,-3.75M396.61,435.73l0,-3.75M411.12,435.73l0,-3.75M425.62,435.73l0,-3.75M440.13,435.73l0,-3.75M454.63,435.73l0,-3.75M469.14,435.73l0,-3.75M483.64,435.73l0,-3.75M498.15,435.73l0,-3.75"/>
+<path d="M92,435.73l0,-7.5M164.52,435.73l0,-7.5M237.05,435.73l0,-7.5M309.58,435.73l0,-7.5M382.11,435.73l0,-7.5M454.63,435.73l0,-7.5"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m89.56,454.24c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m162.61,449.27l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m233.25,459.84c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33m6.07,-5.6c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m305.78,459.84c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33m6.59,-10.57l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m374.74,459.42c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0m9.64,-5.17c0,-4.53,1.2,-5.81,2.46,-5.81c1.22,0,2.41,1.27,2.41,5.81c0,4.74,-1.19,6.03,-2.41,6.03c-1.25,0,-2.46,-1.27,-2.46,-6.03m2.46,-6.52c-1.99,0,-3.92,1.78,-3.92,6.52c0,4.95,1.92,6.73,3.92,6.73c1.97,0,3.86,-1.78,3.86,-6.73c0,-4.74,-1.88,-6.52,-3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m447.27,459.42c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0m10.16,-10.15l5.45,0l0,-1.29l-6.14,0l-0.4,5.93l0.48,0.1c0.59,-0.2,1.27,-0.29,1.9,-0.29c1.83,0,3.06,1.12,3.06,3.22c0,2.02,-1.08,3.34,-3.04,3.34c-0.47,0,-0.87,-0.07,-1.31,-0.19l-0.35,-1.13c-0.22,-0.82,-0.43,-1.06,-0.92,-1.06c-0.38,0,-0.68,0.19,-0.82,0.57c0.4,1.67,1.64,2.52,3.5,2.52c2.64,0,4.35,-1.73,4.35,-4.2c0,-2.55,-1.64,-3.99,-4.05,-3.99c-0.71,0,-1.34,0.1,-1.97,0.31l0.26,-3.83" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="#ff0000" stroke-width="0.62">
+<g transform="translate(454.63,145.62)">
+<path d="m4.64,0c0,2.56,-2.07,4.64,-4.64,4.64c-2.56,0,-4.64,-2.07,-4.64,-4.64c0,-2.56,2.07,-4.64,4.64,-4.64c2.56,0,4.64,2.07,4.64,4.64" id="p0"/>
+</g>
+<use xlink:href="#p0" x="237.05" y="290.68"/>
+<use xlink:href="#p0" x="454.63" y="290.68"/>
+</g>
+</g>
+</g>
+</svg>
diff --git a/docs/geometry/images/distance-3.svg b/docs/geometry/images/distance-3.svg
new file mode 100644 (file)
index 0000000..4590a50
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="531.49px" height="531.49px" version="1.1"
+    xmlns="http://www.w3.org/2000/svg"
+    xmlns:xlink="http://www.w3.org/1999/xlink">
+<desc>Veusz output document</desc>
+<defs>
+<clipPath id="c0">
+<path d="m0,0l531.49,0l0,531.49l-531.49,0l0,-531.49"/>
+</clipPath>
+<clipPath id="c1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</clipPath>
+</defs>
+<g stroke-linejoin="bevel" stroke-linecap="square" stroke="#000000" fill-rule="evenodd">
+<g clip-path="url(#c0)">
+<g fill="none" stroke="none" stroke-width="1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</g>
+</g>
+<g clip-path="url(#c1)">
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,493.75l464.17,0M33.98,470.55l464.17,0M33.98,447.34l464.17,0M33.98,424.13l464.17,0M33.98,400.92l464.17,0M33.98,377.71l464.17,0M33.98,354.5l464.17,0M33.98,331.29l464.17,0M33.98,308.09l464.17,0M33.98,284.88l464.17,0M33.98,261.67l464.17,0M33.98,238.46l464.17,0M33.98,215.25l464.17,0M33.98,192.04l464.17,0M33.98,168.83l464.17,0M33.98,145.62l464.17,0M33.98,122.42l464.17,0M33.98,99.21l464.17,0M33.98,76l464.17,0M33.98,52.79l464.17,0M33.98,29.58l464.17,0"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,493.75l464.17,0M33.98,377.71l464.17,0M33.98,261.67l464.17,0M33.98,145.62l464.17,0M33.98,29.58l464.17,0"/>
+</g>
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,29.58l0,464.17M57.18,29.58l0,464.17M80.39,29.58l0,464.17M103.6,29.58l0,464.17M126.81,29.58l0,464.17M150.02,29.58l0,464.17M173.23,29.58l0,464.17M196.44,29.58l0,464.17M219.64,29.58l0,464.17M242.85,29.58l0,464.17M266.06,29.58l0,464.17M289.27,29.58l0,464.17M312.48,29.58l0,464.17M335.69,29.58l0,464.17M358.9,29.58l0,464.17M382.11,29.58l0,464.17M405.31,29.58l0,464.17M428.52,29.58l0,464.17M451.73,29.58l0,464.17M474.94,29.58l0,464.17M498.15,29.58l0,464.17"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,29.58l0,464.17M150.02,29.58l0,464.17M266.06,29.58l0,464.17M382.11,29.58l0,464.17M498.15,29.58l0,464.17"/>
+</g>
+</g>
+<g clip-path="url(#c0)">
+<g fill="none" stroke-width="1.87">
+<g transform="matrix(0.7071 0.7071 -0.7071 0.7071 266.06 261.67)">
+<path d="m-82.05,-82.05l164.11,0l0,164.11l-164.11,0l0,-164.11"/>
+</g>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M266.06,493.75l0,-464.17"/>
+<path d="M266.06,493.75l-3.75,0M266.06,470.55l-3.75,0M266.06,447.34l-3.75,0M266.06,424.13l-3.75,0M266.06,400.92l-3.75,0M266.06,377.71l-3.75,0M266.06,354.5l-3.75,0M266.06,331.29l-3.75,0M266.06,308.09l-3.75,0M266.06,284.88l-3.75,0M266.06,261.67l-3.75,0M266.06,238.46l-3.75,0M266.06,215.25l-3.75,0M266.06,192.04l-3.75,0M266.06,168.83l-3.75,0M266.06,145.62l-3.75,0M266.06,122.42l-3.75,0M266.06,99.21l-3.75,0M266.06,76l-3.75,0M266.06,52.79l-3.75,0M266.06,29.58l-3.75,0"/>
+<path d="M266.06,493.75l-7.5,0M266.06,377.71l-7.5,0M266.06,261.67l-7.5,0M266.06,145.62l-7.5,0M266.06,29.58l-7.5,0"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m243.74,494.57l0,-0.85l-8.87,0l0,0.85l8.87,0m2.65,4.56c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m243.74,378.53l0,-0.85l-8.87,0l0,0.85l8.87,0m6.22,4.98c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m249.96,151.43c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m246.4,34.97c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M33.98,261.67l464.17,0"/>
+<path d="M33.98,261.67l0,-3.75M57.18,261.67l0,-3.75M80.39,261.67l0,-3.75M103.6,261.67l0,-3.75M126.81,261.67l0,-3.75M150.02,261.67l0,-3.75M173.23,261.67l0,-3.75M196.44,261.67l0,-3.75M219.64,261.67l0,-3.75M242.85,261.67l0,-3.75M266.06,261.67l0,-3.75M289.27,261.67l0,-3.75M312.48,261.67l0,-3.75M335.69,261.67l0,-3.75M358.9,261.67l0,-3.75M382.11,261.67l0,-3.75M405.31,261.67l0,-3.75M428.52,261.67l0,-3.75M451.73,261.67l0,-3.75M474.94,261.67l0,-3.75M498.15,261.67l0,-3.75"/>
+<path d="M33.98,261.67l0,-7.5M150.02,261.67l0,-7.5M266.06,261.67l0,-7.5M382.11,261.67l0,-7.5M498.15,261.67l0,-7.5"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m33.7,280.79l0,-0.85l-8.87,0l0,0.85l8.87,0m2.65,4.56c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m149.75,280.79l0,-0.85l-8.87,0l0,0.85l8.87,0m6.22,4.98c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path
+d="m 283.62,280.17 c 0,-4.53 1.2,-5.81 2.46,-5.81 1.22,0 2.41,1.27 2.41,5.81 0,4.74 -1.19,6.03 -2.41,6.03 -1.25,0 -2.46,-1.27 -2.46,-6.03 m 2.46,-6.52 c -1.99,0 -3.92,1.78 -3.92,6.52 0,4.95 1.92,6.73 3.92,6.73 1.97,0 3.86,-1.78 3.86,-6.73 0,-4.74 -1.88,-6.52 -3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m383.02,285.77c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m495.5,285.35c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="#ff0000" stroke-width="0.62">
+<g transform="translate(266.06,145.62)">
+<path d="m4.64,0c0,2.56,-2.07,4.64,-4.64,4.64c-2.56,0,-4.64,-2.07,-4.64,-4.64c0,-2.56,2.07,-4.64,4.64,-4.64c2.56,0,4.64,2.07,4.64,4.64" id="p0"/>
+</g>
+<use xlink:href="#p0" x="266.06" y="377.71"/>
+<use xlink:href="#p0" x="382.11" y="261.67"/>
+<use xlink:href="#p0" x="150.02" y="261.67"/>
+</g>
+</g>
+</g>
+</svg>
diff --git a/docs/geometry/images/distance-4.svg b/docs/geometry/images/distance-4.svg
new file mode 100644 (file)
index 0000000..edf69bf
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="531.49px" height="531.49px" version="1.1"
+    xmlns="http://www.w3.org/2000/svg"
+    xmlns:xlink="http://www.w3.org/1999/xlink">
+<desc>Veusz output document</desc>
+<defs>
+<clipPath id="c0">
+<path d="m0,0l531.49,0l0,531.49l-531.49,0l0,-531.49"/>
+</clipPath>
+<clipPath id="c1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</clipPath>
+</defs>
+<g stroke-linejoin="bevel" stroke-linecap="square" stroke="#000000" fill-rule="evenodd">
+<g clip-path="url(#c0)">
+<g fill="none" stroke="none" stroke-width="1">
+<path d="m33.98,29.58l464.17,0l0,464.17l-464.17,0l0,-464.17"/>
+</g>
+</g>
+<g clip-path="url(#c1)">
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,493.75l464.17,0M33.98,470.55l464.17,0M33.98,447.34l464.17,0M33.98,424.13l464.17,0M33.98,400.92l464.17,0M33.98,377.71l464.17,0M33.98,354.5l464.17,0M33.98,331.29l464.17,0M33.98,308.09l464.17,0M33.98,284.88l464.17,0M33.98,261.67l464.17,0M33.98,238.46l464.17,0M33.98,215.25l464.17,0M33.98,192.04l464.17,0M33.98,168.83l464.17,0M33.98,145.62l464.17,0M33.98,122.42l464.17,0M33.98,99.21l464.17,0M33.98,76l464.17,0M33.98,52.79l464.17,0M33.98,29.58l464.17,0"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,493.75l464.17,0M33.98,377.71l464.17,0M33.98,261.67l464.17,0M33.98,145.62l464.17,0M33.98,29.58l464.17,0"/>
+</g>
+<g fill="none" stroke="#d3d3d3" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,29.58l0,464.17M57.18,29.58l0,464.17M80.39,29.58l0,464.17M103.6,29.58l0,464.17M126.81,29.58l0,464.17M150.02,29.58l0,464.17M173.23,29.58l0,464.17M196.44,29.58l0,464.17M219.64,29.58l0,464.17M242.85,29.58l0,464.17M266.06,29.58l0,464.17M289.27,29.58l0,464.17M312.48,29.58l0,464.17M335.69,29.58l0,464.17M358.9,29.58l0,464.17M382.11,29.58l0,464.17M405.31,29.58l0,464.17M428.52,29.58l0,464.17M451.73,29.58l0,464.17M474.94,29.58l0,464.17M498.15,29.58l0,464.17"/>
+</g>
+<g fill="none" stroke="#808080" stroke-dasharray="0.62,1.25" stroke-width="0.62">
+<path d="M33.98,29.58l0,464.17M150.02,29.58l0,464.17M266.06,29.58l0,464.17M382.11,29.58l0,464.17M498.15,29.58l0,464.17"/>
+</g>
+</g>
+<g clip-path="url(#c0)">
+<g fill="none" stroke-width="1.87">
+<g transform="translate(266.06,261.67)">
+<path d="m-116.04,-116.04l232.08,0l0,232.08l-232.08,0l0,-232.08"/>
+</g>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M266.06,493.75l0,-464.17"/>
+<path d="M266.06,493.75l-3.75,0M266.06,470.55l-3.75,0M266.06,447.34l-3.75,0M266.06,424.13l-3.75,0M266.06,400.92l-3.75,0M266.06,377.71l-3.75,0M266.06,354.5l-3.75,0M266.06,331.29l-3.75,0M266.06,308.09l-3.75,0M266.06,284.88l-3.75,0M266.06,261.67l-3.75,0M266.06,238.46l-3.75,0M266.06,215.25l-3.75,0M266.06,192.04l-3.75,0M266.06,168.83l-3.75,0M266.06,145.62l-3.75,0M266.06,122.42l-3.75,0M266.06,99.21l-3.75,0M266.06,76l-3.75,0M266.06,52.79l-3.75,0M266.06,29.58l-3.75,0"/>
+<path d="M266.06,493.75l-7.5,0M266.06,377.71l-7.5,0M266.06,261.67l-7.5,0M266.06,145.62l-7.5,0M266.06,29.58l-7.5,0"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m243.74,494.57l0,-0.85l-8.87,0l0,0.85l8.87,0m2.65,4.56c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m243.74,378.53l0,-0.85l-8.87,0l0,0.85l8.87,0m6.22,4.98c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m249.96,151.43c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m246.4,34.97c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="none" stroke-linecap="butt" stroke-width="0.62">
+<path d="M33.98,261.67l464.17,0"/>
+<path d="M33.98,261.67l0,-3.75M57.18,261.67l0,-3.75M80.39,261.67l0,-3.75M103.6,261.67l0,-3.75M126.81,261.67l0,-3.75M150.02,261.67l0,-3.75M173.23,261.67l0,-3.75M196.44,261.67l0,-3.75M219.64,261.67l0,-3.75M242.85,261.67l0,-3.75M266.06,261.67l0,-3.75M289.27,261.67l0,-3.75M312.48,261.67l0,-3.75M335.69,261.67l0,-3.75M358.9,261.67l0,-3.75M382.11,261.67l0,-3.75M405.31,261.67l0,-3.75M428.52,261.67l0,-3.75M451.73,261.67l0,-3.75M474.94,261.67l0,-3.75M498.15,261.67l0,-3.75"/>
+<path d="M33.98,261.67l0,-7.5M150.02,261.67l0,-7.5M266.06,261.67l0,-7.5M382.11,261.67l0,-7.5M498.15,261.67l0,-7.5"/>
+</g>
+<g fill="none" stroke-width="1">
+<path d="m33.7,280.79l0,-0.85l-8.87,0l0,0.85l8.87,0m2.65,4.56c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m149.75,280.79l0,-0.85l-8.87,0l0,0.85l8.87,0m6.22,4.98c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path
+d="m 283.62,280.17 c 0,-4.53 1.2,-5.81 2.46,-5.81 1.22,0 2.41,1.27 2.41,5.81 0,4.74 -1.19,6.03 -2.41,6.03 -1.25,0 -2.46,-1.27 -2.46,-6.03 m 2.46,-6.52 c -1.99,0 -3.92,1.78 -3.92,6.52 0,4.95 1.92,6.73 3.92,6.73 1.97,0 3.86,-1.78 3.86,-6.73 0,-4.74 -1.88,-6.52 -3.86,-6.52" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m383.02,285.77c-0.01,-1.05,-0.03,-2.08,-0.03,-3.11l0,-6l0.07,-2.72l-0.26,-0.19l-3.77,0.97l0,0.62l2.62,-0.29l0,7.61c0,1.03,-0.01,2.06,-0.03,3.11l-2.76,0.33l0,0.55l6.91,0l0,-0.55l-2.73,-0.33" fill="#000000" stroke="none" fill-opacity="1"/>
+<path d="m495.5,285.35c0.96,-1.05,1.87,-2.01,2.36,-2.55c2.74,-2.97,3.63,-4.2,3.63,-5.81c0,-1.97,-1.1,-3.34,-3.46,-3.34c-1.82,0,-3.44,0.92,-3.74,2.76c0.19,0.33,0.45,0.54,0.83,0.54c0.45,0,0.71,-0.33,0.92,-1.08l0.43,-1.34c0.42,-0.12,0.82,-0.15,1.15,-0.15c1.5,0,2.41,1.1,2.41,2.71c0,1.48,-0.82,2.9,-2.69,5.07c-0.84,0.98,-1.9,2.24,-3,3.46l0,1.05l7.71,0l0,-1.31l-6.57,0" fill="#000000" stroke="none" fill-opacity="1"/>
+</g>
+<g fill="#ff0000" stroke-width="0.62">
+<g transform="translate(150.02,145.62)">
+<path d="m4.64,0c0,2.56,-2.07,4.64,-4.64,4.64c-2.56,0,-4.64,-2.07,-4.64,-4.64c0,-2.56,2.07,-4.64,4.64,-4.64c2.56,0,4.64,2.07,4.64,4.64" id="p0"/>
+</g>
+<use xlink:href="#p0" x="382.11" y="377.71"/>
+<use xlink:href="#p0" x="382.11" y="145.62"/>
+<use xlink:href="#p0" x="150.02" y="377.71"/>
+</g>
+</g>
+</g>
+</svg>