当前位置:网站首页>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
边栏推荐
- Linked list interview questions (Graphic explanation)
- Interview Reply of Zhuhai Jinshan
- Wireshark grabs packets to understand its word TCP segment
- Nft智能合约发行,盲盒,公开发售技术实战--拼图篇
- datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
- C语言 - 位段
- hcip--mpls
- 【T31ZL智能视频应用处理器资料】
- Opencv learning notes 8 -- answer sheet recognition
- 数据治理:主数据的3特征、4超越和3二八原则
猜你喜欢
Sanzi chess (C language)
[nonlinear control theory]9_ A series of lectures on nonlinear control theory
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
Leetcode question brushing record | 203_ Remove linked list elements
[cf gym101196-i] waif until dark network maximum flow
[Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
Solution: intelligent site intelligent inspection scheme video monitoring system
In the era of digital economy, how to ensure security?
Learn Arduino with examples
指针和数组笔试题解析
随机推荐
Yu Xia looks at win system kernel -- message mechanism
Redis list detailed explanation of character types yyds dry goods inventory
【云原生】手把手教你搭建ferry开源工单系统
Nacos Development Manual
Leetcode question brushing record | 203_ Remove linked list elements
. Net 6 learning notes: what is NET Core
Go learning notes (3) basic types and statements (2)
MES, APS and ERP are essential to realize fine production
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
Data governance: metadata management
远程存储访问授权
What are the ways to download network pictures with PHP
Make learning pointer easier (3)
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
Iterator Foundation
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
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
二叉树创建 & 遍历
使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
Common functions for PHP to process strings