平方距離(squared distance)一般可以用在數字圖像處理的相關情況下。
兩顏色向量 C 1 {\displaystyle C_{1}} 與 C 2 {\displaystyle C_{2}} 的平方距離為:
( C 1 ⋅ r − C 2 ⋅ r ) 2 + ( C 1 ⋅ g − C 2 ⋅ g ) 2 + ( C 1 ⋅ b − C 2 ⋅ b ) 2 {\displaystyle (C_{1}\cdot r-C_{2}\cdot r)^{2}+(C_{1}\cdot g-C_{2}\cdot g)^{2}+(C_{1}\cdot b-C_{2}\cdot b)^{2}}