当前位置:网站首页>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
边栏推荐
- 二叉树创建 & 遍历
- It's hard to find a job when the industry is in recession
- Risk planning and identification of Oracle project management system
- hcip--mpls
- What are the ways to download network pictures with PHP
- . Net 6 learning notes: what is NET Core
- C语言自定义类型:结构体
- Generator Foundation
- National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
- Learn Arduino with examples
猜你喜欢
Machine learning - decision tree
Risk planning and identification of Oracle project management system
Esrally domestic installation and use pit avoidance Guide - the latest in the whole network
Codeforces Global Round 19(A~D)
From monomer structure to microservice architecture, introduction to microservices
wincc7.5下载安装教程(Win10系统)
The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
Nft智能合约发行,盲盒,公开发售技术实战--拼图篇
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
随机推荐
使用 Dumpling 备份 TiDB 集群数据到兼容 S3 的存储
IP lab, the first weekly recheck
2.10transfrom attribute
NFT smart contract release, blind box, public offering technology practice -- jigsaw puzzle
PHP - Common magic method (nanny level teaching)
21. Delete data
你想知道的ArrayList知识都在这
[nonlinear control theory]9_ A series of lectures on nonlinear control theory
Uibehavior, a comprehensive exploration of ugui source code
Generator Foundation
P3047 [usaco12feb]nearby cows g (tree DP)
Opencv learning notes 8 -- answer sheet recognition
[1. Delphi foundation] 1 Introduction to Delphi Programming
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
链表面试题(图文详解)
NFT smart contract release, blind box, public offering technology practice -- contract
HTTP cache, forced cache, negotiated cache
Inspiration from the recruitment of bioinformatics analysts in the Department of laboratory medicine, Zhujiang Hospital, Southern Medical University
Helm install Minio
Golang DNS 随便写写