当前位置:网站首页>Distance measurement - Euclidean distance
Distance measurement - Euclidean distance
2022-06-11 10:52:00 【Fanyi】
Python Learning Series : Catalog

summary
Euclidean distance , Also known as Euclid distance , We started from primary school 、 Junior high school 、 Distance measurement, which is used in high school and even now .
“ The shortest line between two points ” Everyone has learned it , Here is just a big English name , It's the formula that we use to calculate the distance on the junior and advanced examination paper
Calculation formula
① Euclidean distance on a two-dimensional plane
hypothesis Two dimensional plane There are two points inside : a ( x 1 , y 1 ) a(x_{1},y_{1}) a(x1,y1) And b ( x 2 , y 2 ) b(x_{2},y_{2}) b(x2,y2)
Then the distance formula of the two-dimensional plane is :
d 12 = ( x 1 − x 2 ) 2 + ( y 1 − y 2 ) 2 d_{12}=\sqrt{(x_{1}-x_{2})^2+(y_{1}-y_{2})^2} d12=(x1−x2)2+(y1−y2)2

for instance , Like the one above A ( 2 , 2 ) A(2,2) A(2,2) And B ( 6 , 6 ) B(6,6) B(6,6) At two o 'clock , Calculation A B AB AB The distance between two points is :
d A B = ( 6 − 2 ) 2 + ( 6 − 2 ) 2 = 4 2 + 4 2 = 4 2 \begin{aligned} d_{AB} &=\sqrt{(6-2)^2+(6-2)^2}\\ &=\sqrt{4^2+4^2}\\ &= 4\sqrt{2} \end{aligned} dAB=(6−2)2+(6−2)2=42+42=42
② Euclidean distance in three-dimensional space
hypothesis three-dimensional space There are two points inside : a ( x 1 , y 1 , z 1 ) a(x_{1},y_{1},z_{1}) a(x1,y1,z1) And b ( x 2 , y 2 , z 2 ) b(x_{2},y_{2},z_{2}) b(x2,y2,z2)
Then the distance formula of three-dimensional space is :
d 12 = ( x 1 − x 2 ) 2 + ( y 1 − y 2 ) 2 + ( z 1 − z 2 ) 2 d_{12}=\sqrt{(x_{1}-x_{2})^2+(y_{1}-y_{2})^2+(z_{1}-z_{2})^2} d12=(x1−x2)2+(y1−y2)2+(z1−z2)2

for instance , Like the one above A ( 0 , 0 , 4 ) A(0,0,4) A(0,0,4) And B ( 0 , 2 , 0 ) B(0,2,0) B(0,2,0) At two o 'clock , Calculation A B AB AB The distance between two points is :
d A B = ( 0 − 0 ) 2 + ( 0 − 2 ) 2 + ( 4 − 0 ) 2 = 0 + 4 + 16 = 2 5 \begin{aligned} d_{AB} &=\sqrt{(0-0)^2+(0-2)^2+(4-0)^2}\\ &=\sqrt{0+4+16}\\ &= 2\sqrt{5} \end{aligned} dAB=(0−0)2+(0−2)2+(4−0)2=0+4+16=25
③ n Euclidean distance in dimensional space
hypothesis n Dimensional space There are two points inside : a ( x 11 , x 12 , . . . , x 1 n ) a(x_{11},x_{12},...,x_{1n}) a(x11,x12,...,x1n) And b ( x 21 , y 22 , . . . , z 2 n ) b(x_{21},y_{22},...,z_{2n}) b(x21,y22,...,z2n)
be n The distance formula of dimensional space is :
d 12 = ∑ k = 1 n ( x 1 k − x 2 k ) 2 d_{12}=\sqrt{\sum_{k=1}^n(x_{1k}-x_{2k})^2} d12=k=1∑n(x1k−x2k)2
Empathy ,n Dimensional space is also , Do the above operations on the corresponding vector .(n Wei's painting doesn't come out , Need to be expressed in other forms , Just like the picture below ).


边栏推荐
- NFT 2.0: the next generation of NFT will be lean and trustworthy
- Cadence OrCAD capture design method to avoid misoperation graphic tutorial
- Probability theory: calculating confidence intervals
- Taking the cooperation between different banks as an example, the construction of small program ecology
- Ngui, floating blood
- 云画质助手iApp源码
- 地铁路线图云开发小程序源码和配置教程
- 杰理之BLEPR0 和 PR1 当普通 IO 口使用【篇】
- Kingbasees create database objects in batch
- Leetcode 1961. Check whether the string is an array prefix
猜你喜欢

Campus lost and found applet source code can be used for graduation design

Team level safety training, new employee induction training education courseware, full content ppt application

杰理之获取 BLE 查看代码异常复位等异常情况原因【篇】

基于位置服务(LBS)的SSM的框架实现的兴趣社交软件平台设计与实现

云开发mbti人格类型测试助手微信小程序源码

Preview component packaging graphic tutorial in cadence OrCAD capture schematic design interface

NFT products are alive

VMware install win7 virtual machine

Fix the problem that uicollectionview does not reach the bottom security zone

微信云开发Al短视频一键换脸小程序源码
随机推荐
golang编译和链接参数,运行时
使用 Ribbon 实现客户端负载均衡
Série de démarrage C # (XI) - - tableaux multidimensionnels
NFT products are alive
Hardware Description Language HDL
基于C语言实现比赛评分系统
使用 Feign 实现声明式 REST 调用
Mxnet construction and implementation of alexnet model (comparison with lenet)
MySQL download, installation and use - complete and detailed steps
MySQL foundation part common constraints summary part 2
Pyramidtnt: TNT with characteristic pyramid structure
Where is it safer to open an account for soda ash futures? How much money can you do?
Probability theory: calculating confidence intervals
Leetcode 1995. 统计特殊四元组(暴力枚举)
Half of the property rights of the house are registered in the woman's name when they are in love, and they want to return after they break up
PHP仿网易云原创音乐分享平台网站源码
Source code of digital collection app system
使用RSA与base64对字符串进行加密解密
FPGA infrastructure [reference ug998]
VMware install win7 virtual machine