Book contents
Contents
raw Math

Given two nonzero vectors \(\mathbf{a}\) and \(\mathbf{b}\) with a common origin, we want a direction that divides the angle between them into two equal parts. Adding the original vectors does not generally work: \(\mathbf{a}+\mathbf{b}\) is an angle bisector only when both vectors have the same length. The correct construction first removes their lengths.

Problem Setup

A nonzero vector determines a ray from the origin. Its length does not affect the angle, so the problem depends only on the unit directions \(\hat{\mathbf{a}}\) and \(\hat{\mathbf{b}}\). Let

\[ heta=\arccos\left( \frac{\mathbf{a}\cdot\mathbf{b}} {\lVert\mathbf{a}\rVert\lVert\mathbf{b}\rVert} \right), \qquad 0\le\theta\le\pi. \]

An internal bisector ray forms the angle \(\theta/2\) with each input ray. Reversing its direction gives the same geometric bisector line but the opposite ray. The formulas below select the ray pointing between the two input directions when \(0\le\theta<\pi\).

a b a + b θ/2 θ/2

Equal-length vectors span a rhombus. Its diagonal \(\hat{\mathbf{a}}+\hat{\mathbf{b}}\) bisects the angle between them.

Normalize the Two Directions

Let

\[ \hat{\mathbf{a}}=\frac{\mathbf{a}}{\lVert\mathbf{a}\rVert}, \qquad \hat{\mathbf{b}}=\frac{\mathbf{b}}{\lVert\mathbf{b}\rVert}. \]

Both unit vectors have length one. They therefore form adjacent sides of a rhombus, and the parallelogram rule identifies its diagonal as

\[ \mathbf{d}_{+}=\hat{\mathbf{a}}+\hat{\mathbf{b}}. \]

A diagonal of a rhombus bisects the angles at its endpoints. Consequently, \(\mathbf{d}_{+}\) points along the internal angle bisector whenever \(\hat{\mathbf{a}}\neq-\hat{\mathbf{b}}\).

Algebraic Proof

Let \(\theta\in[0,\pi]\) be the angle between the two vectors. Since \(\hat{\mathbf{a}}\cdot\hat{\mathbf{b}}=\cos\theta\), the dot product of \(\mathbf{d}_{+}\) with either unit direction is the same:

\[ \begin{aligned} \mathbf{d}_{+}\cdot\hat{\mathbf{a}} &=(\hat{\mathbf{a}}+\hat{\mathbf{b}})\cdot\hat{\mathbf{a}} =1+\cos\theta,\\ \mathbf{d}_{+}\cdot\hat{\mathbf{b}} &=(\hat{\mathbf{a}}+\hat{\mathbf{b}})\cdot\hat{\mathbf{b}} =1+\cos\theta. \end{aligned} \]

Dividing both equations by \(\lVert\mathbf{d}_{+}\rVert\) shows that the cosines of the two angles are equal. Both angles lie between \(0\) and \(\pi\), where cosine is one-to-one, so the angles themselves are equal.

Equivalently, among directions in the plane spanned by \(\mathbf{a}\) and \(\mathbf{b}\), a unit vector \(\hat{\mathbf{m}}\) lies on an angle-bisector line when its scalar projections onto the two unit directions have equal magnitude:

\[ \left|\hat{\mathbf{m}}\cdot\hat{\mathbf{a}}\right| =\left|\hat{\mathbf{m}}\cdot\hat{\mathbf{b}}\right|. \]

The span restriction matters in dimensions above two, where perpendicular components would otherwise create additional solutions. Within that plane, removing the absolute values separates the two bisector lines. Equal projections give the internal direction \(\hat{\mathbf{a}}+\hat{\mathbf{b}}\), while opposite projections give the external direction \(\hat{\mathbf{a}}-\hat{\mathbf{b}}\).

The Unit Bisector

The sum gives the correct direction but is not generally a unit vector. Its squared length is

\[ \begin{aligned} \lVert\mathbf{d}_{+}\rVert^2 &=(\hat{\mathbf{a}}+\hat{\mathbf{b}})\cdot (\hat{\mathbf{a}}+\hat{\mathbf{b}})\\ &=2+2\cos\theta\\ &=4\cos^2\frac{\theta}{2}. \end{aligned} \]

For \(0\leq\theta<\pi\), the internal unit bisector is therefore

\[ \boxed{ \hat{\mathbf{m}} =\frac{\hat{\mathbf{a}}+\hat{\mathbf{b}}} {\lVert\hat{\mathbf{a}}+\hat{\mathbf{b}}\rVert} =\frac{\hat{\mathbf{a}}+\hat{\mathbf{b}}} {2\cos(\theta/2)} }. \]

A Formula without Explicit Normalized Vectors

Multiplying the sum of unit vectors by the positive scalar \(\lVert\mathbf{a}\rVert\lVert\mathbf{b}\rVert\) does not change its direction:

\[ \begin{aligned} \lVert\mathbf{a}\rVert\lVert\mathbf{b}\rVert (\hat{\mathbf{a}}+\hat{\mathbf{b}}) &=\lVert\mathbf{b}\rVert\mathbf{a} +\lVert\mathbf{a}\rVert\mathbf{b}. \end{aligned} \]

Hence another vector along the internal bisector is

\[ \boxed{ \mathbf{c} =\lVert\mathbf{b}\rVert\mathbf{a} +\lVert\mathbf{a}\rVert\mathbf{b} }. \]

This form avoids dividing each input vector separately, but \(\mathbf{c}\) still has to be normalized when a unit direction is required. Any positive multiple of either formula describes the same bisector ray.

The External Angle Bisector

Replacing \(\hat{\mathbf{b}}\) by \(-\hat{\mathbf{b}}\) applies the same construction to the supplementary angle. This gives the external bisector direction

\[ \mathbf{d}_{-}=\hat{\mathbf{a}}-\hat{\mathbf{b}}. \]

When \(0<\theta\leq\pi\), its normalized form is

\[ \boxed{ \hat{\mathbf{n}} =\frac{\hat{\mathbf{a}}-\hat{\mathbf{b}}} {\lVert\hat{\mathbf{a}}-\hat{\mathbf{b}}\rVert} =\frac{\hat{\mathbf{a}}-\hat{\mathbf{b}}} {2\sin(\theta/2)} }. \]

The internal and external bisectors are perpendicular because

\[ (\hat{\mathbf{a}}+\hat{\mathbf{b}})\cdot (\hat{\mathbf{a}}-\hat{\mathbf{b}}) =\lVert\hat{\mathbf{a}}\rVert^2- \lVert\hat{\mathbf{b}}\rVert^2 =0. \]

Degenerate Cases

In numerical code, the sum should therefore be checked before normalization. If \(\lVert\hat{\mathbf{a}}+\hat{\mathbf{b}}\rVert\) is close to zero, the internal bisector is numerically indeterminate and requires an application-specific perpendicular direction.

Example

Consider

\[ \mathbf{a}=\begin{pmatrix}3\\0\end{pmatrix}, \qquad \mathbf{b}=\begin{pmatrix}0\\4\end{pmatrix}. \]

The normalized vectors are

\[ \hat{\mathbf{a}}=\begin{pmatrix}1\\0\end{pmatrix}, \qquad \hat{\mathbf{b}}=\begin{pmatrix}0\\1\end{pmatrix}. \]

Thus the internal unit bisector is

\[ \hat{\mathbf{m}} =\frac{(1,1)^{\mathsf T}}{\sqrt{2}} =\begin{pmatrix}1/\sqrt{2}\\1/\sqrt{2}\end{pmatrix}. \]

Directly adding the original vectors would give \((3,4)^{\mathsf T}\), which does not point at \(45^\circ\) and therefore is not the angle bisector. The weighted formula corrects the unequal lengths:

\[ \lVert\mathbf{b}\rVert\mathbf{a} +\lVert\mathbf{a}\rVert\mathbf{b} =4\begin{pmatrix}3\\0\end{pmatrix} +3\begin{pmatrix}0\\4\end{pmatrix} =\begin{pmatrix}12\\12\end{pmatrix}. \]

In two-dimensional applications, the same normalization, addition, and length operations are available in Vector2.js.

The norm, normalization, and angle concepts used here are developed in Introduction to Vectors, while the projection criterion follows from the dot product.