当前位置:网站首页>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 + b13、 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 .
边栏推荐
- 实战:fabric 用户证书吊销操作流程
- Nacos installation and service registration
- Win11缺少dll文件怎么办?Win11系统找不到dll文件修复方法
- Text组件新增内容通过tag_config设置前景色、背景色
- K210 learning notes (IV) k210 runs multiple models at the same time
- Technology cloud report: how many hurdles does the computing power network need to cross?
- Hcip day 16
- 70. Climbing Stairs. Sol
- AD637使用笔记
- Blocking protocol for concurrency control
猜你喜欢

K210学习笔记(四) K210同时运行多个模型

Depth first DFS and breadth first BFS -- traversing adjacency tables

PyGame practical project: write Snake games with 300 lines of code

数博会精彩回顾 | 彰显科研实力,中创算力荣获数字化影响力企业奖

How can Bluetooth in notebook computer be used to connect headphones

Performance monitoring of database tuning solutions

Pl/sql basic syntax

Oracle triggers

What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method

Bitbucket installation configuration
随机推荐
[groovy] mop meta object protocol and meta programming (execute groovy methods through metamethod invoke)
Metaverse Ape上线倒计时,推荐活动火爆进行
What changes has Web3 brought to the Internet?
90后测试员:“入职阿里,这一次,我决定不在跳槽了”
Interprocess communication in the "Chris Richardson microservice series" microservice architecture
Solutions for unexplained downtime of MySQL services
Leetcode simple question check whether all characters appear the same number of times
C language knowledge points link
Form artifact
50. Pow(x, n). O(logN) Sol
[Yugong series] go teaching course in July 2022 004 go code Notes
Alternating merging strings of leetcode simple questions
Pl/sql basic case
Kubernetes Administrator certification (CKA) exam notes (IV)
点到直线的距离直线的交点及夹角
PyGame practical project: write Snake games with 300 lines of code
70. Climbing Stairs. Sol
When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
Technology cloud report won the special contribution award for the 10th anniversary of 2013-2022 of the "cloud Ding Award" of the global cloud computing conference
Create a virtual machine on VMware (system not installed)