当前位置:网站首页>Distance entre les points et les lignes
Distance entre les points et les lignes
2022-07-05 22:19:00 【Alex1801】
1、Distance entre le point et la ligne droite
PEn ligne droiteABDistance de.
//PUn peu au - delà de la ligne,ABDeux paramètres pour le segment
float getDist_P2L(CvPoint pointP, CvPoint pointA, CvPoint pointB)
{
//Trouver l'équation linéaire
int A = 0, B = 0, C = 0;
A = pointA.y - pointB.y;
B = pointB.x - pointA.x;
C = pointA.x*pointB.y - pointA.y*pointB.x;
//Formule de distance entre le point d'insertion et la ligne droite
float distance = 0;
distance = ((float)abs(A*pointP.x + B*pointP.y + C)) / ((float)sqrtf(A*A + B*B));
return distance;
}
2、Intersection des lignes
Exprimer une ligne avec un point oblique,Ensuite, nous résolvons le système d'équations composé de deux lignes droites.
Compris.:
x0 = (b2 - b1) / (k1 - k2 + 1e-4)
y0 = k1 * x0 + b1
3、 L'angle de la ligne droite
Ligne droite connue l1:y=k1x+b1,l2:y=k2x+b2, Trouvez l'angle entre ces deux lignes .
Conclusions:
l1 À l2 L'angle de braquage de θ,Et tanθ=(k2- k1)/(1+ k1*k2)
l1 Avec l2 L'angle inclus est θ,Et tanθ=∣(k2- k1)/(1+ k1*k2)∣
Attention!: L'angle entre deux lignes est inférieur à 90° Angle aigu de , Apparemment, dans la formule de l'angle inclus “Angle” Ce n'est pas l'angle entre deux lignes droites .
边栏推荐
- 数据泄露怎么办?'华生·K'7招消灭安全威胁
- 数博会精彩回顾 | 彰显科研实力,中创算力荣获数字化影响力企业奖
- 2022-07-05: given an array, you want to query the maximum value in any range at any time. If it is only established according to the initial array and has not been modified in the future, the RMQ meth
- The new content of the text component can be added through the tag_ Config set foreground and background colors
- Search: Future Vision (moving sword)
- Sparse array [matrix]
- What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
- How to add new fields to mongodb with code (all)
- Livelocks and deadlocks of concurrency control
- AD637使用筆記
猜你喜欢
Solutions for unexplained downtime of MySQL services
A substring with a length of three and different characters in the leetcode simple question
"Chris Richardson microservices series" uses API gateway to build microservices
What about data leakage? " Watson k'7 moves to eliminate security threats
极狐公司官方澄清声明
Cobaltstrike builds an intranet tunnel
Granularity of blocking of concurrency control
Installation of VMware Workstation
Interprocess communication in the "Chris Richardson microservice series" microservice architecture
AD637使用笔记
随机推荐
C language knowledge points link
等到产业互联网时代真正发展成熟,我们将会看待一系列的新产业巨头的出现
Type of fault
Advantages and disadvantages of the "Chris Richardson microservice series" microservice architecture
IIC bus realizes client device
How to quickly experience oneos
Basic grammar of interview (Part 1)
Some tutorials install the database on ubantu so as not to occupy computer memory?
Matlab draws a cute fat doll
Two stage locking protocol for concurrency control
Decorator learning 01
Meituan dynamic thread pool practice ideas, open source
Oracle triggers
Summary of concurrency control
What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
344. Reverse String. Sol
Oracle views the data size of a table
Sentinel production environment practice (I)
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
The difference between MVVM and MVC