当前位置:网站首页>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 .
边栏推荐
- 如何开发引入小程序插件
- GWT module may need to be (RE) compiled reduce - GWT module may need to be (RE) compiled reduce
- [groovy] mop meta object protocol and meta programming (execute groovy methods through metamethod invoke)
- Sub total of Pico development
- Web3为互联网带来了哪些改变?
- Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
- Business learning of mall commodity module
- Metaverse Ape获Negentropy Capital种子轮融资350万美元
- Oracle advanced query
- 119. Pascal‘s Triangle II. Sol
猜你喜欢

MySQL连接断开报错MySQLdb._exceptions.OperationalError 4031, The client was disconnected by the server

Three "factions" in the metauniverse

Talking about MySQL index

Server optimization of performance tuning methodology

How can Bluetooth in notebook computer be used to connect headphones

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

opencv 判断点在多边形内外

Two stage locking protocol for concurrency control

U盘的文件无法删除文件怎么办?Win11无法删除U盘文件解决教程
![[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)](/img/48/cd7960bbbc51a967b20da410bf81fe.jpg)
[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)
随机推荐
The difference between MVVM and MVC
笔记本电脑蓝牙怎么用来连接耳机
Leetcode simple question ring and rod
从零开始实现lmax-Disruptor队列(四)多线程生产者MultiProducerSequencer原理解析
Draw a red lantern with MATLAB
Evolution of large website architecture and knowledge system
Technology cloud report: how many hurdles does the computing power network need to cross?
如何创建线程
509. Fibonacci Number. Sol
A trip to Suzhou during the Dragon Boat Festival holiday
数据泄露怎么办?'华生·K'7招消灭安全威胁
Decorator learning 01
"Chris Richardson microservices series" uses API gateway to build microservices
Oracle triggers
Calculation method of boundary IOU
Overriding equals() & hashCode() in sub classes … considering super fields
Promql demo service
How to add new fields to mongodb with code (all)
Sub total of Pico development
Ad637 notes d'utilisation