Math Lines in three dimensions Point on a line segment

Point on a line segment?

Checking whether a point is on a line segment is like finding out if a point is on a line but with one additional condition.

i

Method

Point $P$ on line segment $\overline{AB}$?

1. Set up linear equation from $A$ and $B$
2. Finding out if a point is on a line with $P$ on $g_{AB}$
3. $r$ must be between 0 and 1*
*The requirement is that the linear equation is $\vec{x} = \vec{OA} + r \cdot \vec{AB}$ (no other support vector or direction vector).

Example

Is the point $P(-3|14|10)$ on the line segment $\overline{AB}$ ?

$A(3|4|6)$ and $B(0|9|8)$

1. Set up $g_{AB}$

Set up the linear equation from two points.

$\text{g: } \vec{x} = \vec{OA} + r \cdot \vec{AB}$

$\text{g: } \vec{x} = \begin{pmatrix} 3 \\ 4 \\ 6 \end{pmatrix} + r \cdot \begin{pmatrix} -3 \\ 5 \\ 2 \end{pmatrix}$

2. Point on the line

The position vector (vector with the coordinates of the point) of $A$ must be inserted for $\vec{x}$ in $g$.

$\begin{pmatrix} -3 \\ 14 \\ 10 \end{pmatrix} = \begin{pmatrix} 3 \\ 4 \\ 6 \end{pmatrix} + r \cdot \begin{pmatrix} -3 \\ 5 \\ 2 \end{pmatrix}$

Now we set up an equation system and solve it. Every row is an equation.

1. $-3=3-3r$
2. $14=4+5r$
3. $10=6+2r$

1. $r=2$
2. $r=2$
3. $r=2$
3. Check

$r=2$ is the case in all equations, so the point is on the line $g_{AB}$. However, the point is not on the line segment $\overline{AB}$, because $r>1$.

=> The point $P$ ist not located on the line segment.