当前位置:网站首页>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 .
边栏推荐
- Practice: fabric user certificate revocation operation process
- 1.3 years of work experience, double non naked resignation agency face-to-face experience [already employed]
- How to develop and introduce applet plug-ins
- Granularity of blocking of concurrency control
- Common interview questions of JVM manufacturers
- Promql demo service
- Server optimization of performance tuning methodology
- Platformio create libopencm3 + FreeRTOS project
- A substring with a length of three and different characters in the leetcode simple question
- Serializability of concurrent scheduling
猜你喜欢
[groovy] groovy dynamic language features (automatic type inference of function arguments in groovy | precautions for function dynamic parameters)
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
每日刷题记录 (十四)
Leetcode simple question: check whether each row and column contain all integers
MySQL actual combat 45 lecture learning (I)
Metaverse Ape上线倒计时,推荐活动火爆进行
Meituan dynamic thread pool practice ideas, open source
Stored procedures and stored functions
AD637使用笔记
Sentinel production environment practice (I)
随机推荐
Did you brush the real title of the blue bridge cup over the years? Come here and teach you to counter attack!
The American Championship is about to start. Are you ready?
FBO and RBO disappeared in webgpu
Leetcode simple question: find the nearest point with the same X or Y coordinate
Implementation technology of recovery
The simple problem of leetcode is to split a string into several groups of length K
极狐公司官方澄清声明
Text组件新增内容通过tag_config设置前景色、背景色
Business learning of mall commodity module
Storage optimization of performance tuning methodology
Performance testing of software testing
90后测试员:“入职阿里,这一次,我决定不在跳槽了”
Assign the output of a command to a variable [repeat] - assigning the output of a command to a variable [duplicate]
Installation of VMware Workstation
实战:fabric 用户证书吊销操作流程
Go语言学习教程(十五)
A substring with a length of three and different characters in the leetcode simple question
微服務鏈路風險分析
How to view Apache log4j 2 remote code execution vulnerability?
Nacos 的安装与服务的注册