当前位置:网站首页>Pyqt5 development tips - obtain Manhattan distance between coordinates
Pyqt5 development tips - obtain Manhattan distance between coordinates
2022-07-06 08:00:00 【[email protected]】
PyQt5 Development tips—— Get Manhattan distance between coordinates
Introduction to Manhattan distance
We can define the formal meaning of Manhattan distance as L1- Distance or city block distance , That is to say, the sum of the distance of the projection of the line segment formed by two points to the axis in the fixed rectangular coordinate system of Euclidean space .
For example, on the plane , coordinate (x1, y1) The point of P1 And coordinates (x2, y2) The point of P2 The Manhattan distance is :
It should be noted that , Manhattan distance depends on the rotation of the coordinate system , Not the translation or mapping of the system on the coordinate axis .
The reason why Manhattan distance is named is from the city planned as a square building block ( Such as Manhattan ) between , The shortest driving path ( Ignore the one-way lanes in Manhattan and only exist in 3、14 The oblique lane of the avenue ). Any three blocks to the East 、 The path to Beiliu block must take at least block 9 , There is no other shortcut .
API
int manhattanLength (self)
x = (btn1.pos() - btn2.pos()).manhattanLength()
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131848202817.html
边栏推荐
- Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
- 数据治理:微服务架构下的数据治理
- A Closer Look at How Fine-tuning Changes BERT
- HTTP cache, forced cache, negotiated cache
- 数据治理:误区梳理篇
- Nc204382 medium sequence
- MySQL view tablespace and create table statements
- Helm install Minio
- [factorial inverse], [linear inverse], [combinatorial counting] Niu Mei's mathematical problems
- Document 2 Feb 12 16:54
猜你喜欢
Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
Linked list interview questions (Graphic explanation)
在 uniapp 中使用阿里图标
【Redis】NoSQL数据库和redis简介
Leetcode question brushing record | 203_ Remove linked list elements
Chinese Remainder Theorem (Sun Tzu theorem) principle and template code
wincc7.5下载安装教程(Win10系统)
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
让学指针变得更简单(三)
Description of octomap averagenodecolor function
随机推荐
Hill sort c language
Webrtc series-h.264 estimated bit rate calculation
[redis] Introduction to NoSQL database and redis
wincc7.5下载安装教程(Win10系统)
Sanzi chess (C language)
继电反馈PID控制器参数自整定
好用的TCP-UDP_debug工具下载和使用
1202 character lookup
P3047 [usaco12feb]nearby cows g (tree DP)
What are the ways to download network pictures with PHP
使用 TiUP 升级 TiDB
[Yugong series] February 2022 U3D full stack class 010 prefabricated parts
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
matplotlib. Widgets are easy to use
File upload of DVWA range
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
你想知道的ArrayList知识都在这
CAD ARX 获取当前的视口设置
[cf gym101196-i] waif until dark network maximum flow
shu mei pai