当前位置:网站首页>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 .
边栏推荐
- [agc009e] eternal average - conclusion, DP
- A trip to Suzhou during the Dragon Boat Festival holiday
- Serializability of concurrent scheduling
- Metaverse Ape猿界应邀出席2022·粤港澳大湾区元宇宙和web3.0主题峰会,分享猿界在Web3时代从技术到应用的文明进化历程
- [Yugong series] go teaching course in July 2022 004 go code Notes
- Storage optimization of performance tuning methodology
- Some tutorials install the database on ubantu so as not to occupy computer memory?
- The statistics of leetcode simple question is the public string that has appeared once
- How to add new fields to mongodb with code (all)
- The simple problem of leetcode is to split a string into several groups of length K
猜你喜欢
Advantages and disadvantages of the "Chris Richardson microservice series" microservice architecture
Practice: fabric user certificate revocation operation process
Alternating merging strings of leetcode simple questions
CA certificate trampled pit
数据泄露怎么办?'华生·K'7招消灭安全威胁
Serializability of concurrent scheduling
What about data leakage? " Watson k'7 moves to eliminate security threats
Leetcode simple question: find the nearest point with the same X or Y coordinate
boundary IoU 的计算方式
[Yugong series] go teaching course in July 2022 004 go code Notes
随机推荐
点到直线的距离直线的交点及夹角
航海日答题小程序之航海知识竞赛初赛
opencv 判断点在多边形内外
Assign the output of a command to a variable [repeat] - assigning the output of a command to a variable [duplicate]
The simple problem of leetcode is to split a string into several groups of length K
装饰器学习01
[groovy] mop meta object protocol and meta programming (execute groovy methods through metamethod invoke)
344. Reverse String. Sol
极狐公司官方澄清声明
The difference between MVVM and MVC
Interview questions for famous enterprises: Coins represent a given value
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
Blocking protocol for concurrency control
GWT module may need to be (RE) compiled reduce - GWT module may need to be (RE) compiled reduce
如何开发引入小程序插件
如何快速体验OneOS
Oracle hint understanding
How to develop and introduce applet plug-ins
Form artifact
Sentinel production environment practice (I)