二维中两个向量的平分线(可能共线)
一般如何找到两个向量的二等分 b = (bx, by)(我们考虑两个非零向量 u = (ux, uy), v = (vx, vy),可能是共线的)。
对于非共线向量,我们可以写:
bx = ux/|u| + vx / |v|
by = uy/|u| + vy / |v|
但对于共线向量
bx = by = 0.
示例:
u = (0 , 1)
v = (0, -1)
b = (0, 0)
How to find a bisecor b = (bx, by) of two vectors in general (we consider two non–zero vectors u = (ux, uy), v = (vx, vy), that may be collinear ).
For non-collinear vector we can write:
bx = ux/|u| + vx / |v|
by = uy/|u| + vy / |v|
But for collinear vectors
bx = by = 0.
Example:
u = (0 , 1)
v = (0, -1)
b = (0, 0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通用且统一的方法是获取两个向量的角度
并创建具有平均角度的新向量:
这样,您就可以避免使用相反向量观察到的陷阱。
PS:请注意,“平分线”向量的含义存在歧义:通常有两个平分线向量(通常一个用于较小的角度,一个用于较大的角度)。如果你想要较小角度内的平分线向量,那么你原来的公式就很好了;您可以单独处理您观察到的特殊情况,例如,如果您的公式产生以下结果,则通过采用与两个输入向量中的任何一个正交的向量
(-uy/|u|, ux/|u|)
零向量。A general and uniform approach is to get the angle of both vectors
and to create a new vector with the average angle:
This way, you avoid the pitfall that you observed with opposite vectors.
PS: Note that there is an ambiguity in what the "bisector" vector is: there are generally two bisector vectors (typically one for the smaller angle and one for the larger angle). If you want the bisector vector inside the smaller angle, then your original formula is quite good; you may handle separately the special case that you observed for instance by taking a vector orthogonal to any of the two input vectors
(-uy/|u|, ux/|u|)
if your formula yields the null vector.求 u 和 v 的单位平分向量。
示例:
To find the unit bisection vectors of u and v.
Example: