在垂直点与直线相交的地方找到x和y坐标 [英] Find x and y coordinates where a perpendicular point crosses a straight line
本文介绍了在垂直点与直线相交的地方找到x和y坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是对此以下图为例:
我所知道的:
-
点
-
x
和y
坐标. - 因此,我也知道
D-E
线的斜率和截距
D
,E
和P
的x
andy
coordinates of pointsD
,E
, andP
.- Therefore, I also know slope and intercept of
D-E
line
我想知道的事情:
-
点
-
x
和y
坐标. (这是穿过D-E
线的点).
Q
的x
andy
coordinates of pointQ
. (This is the point which crosses theD-E
line).
推荐答案
符号P=[px,py], D=[dx,dy], E=[ex,ey], Q=[qx,qy]
第一:
R=P-D=[px-dx, py-dy]=[rx,ry]
K=E-D=[ex-dx, ey-dy]=[kx, ky]
然后
z=dot(R,K)/dot(K,K)=(rx*kx+ry*ky) / (kx*kx+ky*ky)
最后
Q=D+z*K=[dx+z*kx, dy+z*ky]
R是从D点开始到K点的向量,K是从D点开始到E点的向量.使用此方法,我们进行了标量投影来计算结果Q.有关概念此处
The R is vector which start on point D and ends on point K, the K is vector which start on point D and ends on point E. Using this we made scalar projection to calculate result Q. More info about concept here
这篇关于在垂直点与直线相交的地方找到x和y坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文