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}$?
- Set up linear equation from $A$ and $B$
- Finding out if a point is on a line with $P$ on $g_{AB}$
- $r$ must be between 0 and 1*
Example
Is the point $P(-3|14|10)$ on the line segment $\overline{AB}$ ?
$A(3|4|6)$ and $B(0|9|8)$
-
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}$
-
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.
- $-3=3-3r$
- $14=4+5r$
- $10=6+2r$
- $r=2$
- $r=2$
- $r=2$
-
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.