3

一般に、2 つのベクトルのバイセコール b = (bx, by) を見つける方法 (2 つのゼロでないベクトル 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)
4

2 に答える 2

6

一般的で均一なアプローチは、両方のベクトルの角度を取得することです

theta_u = math.atan2(ux, uy)
theta_v = math.atan2(vx, vy)

平均角度で新しいベクトルを作成するには:

middle_theta = (theta_u+theta_v)/2
(bx, by) = (cos(middle_theta), sin(middle_theta))

このようにして、反対ベクトルで観察した落とし穴を回避します。

PS : 「二等分線」ベクトルが何であるかにはあいまいさがあることに注意してください。通常、二等分線ベクトルは 2 つあります (通常、1 つは小さい角度用で、もう 1 つは大きい角度用です)。小さい角度の内側に二等分ベクトルが必要な場合は、元の式は非常に適切です。(-uy/|u|, ux/|u|)たとえば、数式が null ベクトルを生成する場合、2 つの入力ベクトルのいずれかに直交するベクトルを取得することによって、観察した特殊なケースを個別に処理できます。

于 2011-07-03T13:05:35.923 に答える
5

u と v の単位二等分ベクトルを求めます。

if u/|u|+v/|v| !=0

first calculate the unit vector of u and v

then use the parallelogram rule to get the bisection (just add them)

since they both have unit of 1, their sum is the bisector vector 

then calculate the unit vector of the calculated vector.

else (if u/|u|+v/|v| ==0):
 (if you use the method above, it's like a indintermination: 0*infinity=?)

 if you want the bisector of (u0v) if u/|u| = (cos(t),sin(t)) 
 take b=(cost(t+Pi/2),sin(t+Pi/2)) = (-sin(t),cos(t) )as the bisector
 therefore if u/|u|=(a1,a2) chose b=(-a2,a1)

例:

u=(0,1)
v=(0,-1)
the bisector of (u0v):
b=(-1,0)
于 2011-07-03T12:34:56.873 に答える