# Checking whether a point lies on a wide line segment

I know how to define a point on the segment, but I have this piece is a wide interval. The line has a width.

I have $x_1$ $y_1$, $x_2$ $y_2$, width and $x_3$ $y_3$

$x_3$ and $x_4$ what you need to check.

perhaps someone can help, and function in $\Bbb{C}$ #

-
Sorry, I really don't understand what you're asking. Can you clarify? –  Billy Aug 27 '11 at 9:56
I edited the title to make it more descriptive, but I couldn't really make enough sense of the question itself to edit it. I suspect it means something like this: I have three points on the plane, $A=(x_1,y_1)$, $B=(x_2,y_2)$ and $C=(x_3,y_3)$. How do I check whether $C$ lies in the rectangle formed by moving the line segment $AB$ up to distance $w$ (or $w/2$?) in either direction along its normal? –  Ilmari Karonen Aug 27 '11 at 18:01

Trying to understand your question, perhaps this picture might help.

You seem to be asking how to find out whether the point $C$ is inside the thick line $AB$.

You should drop a perpendicular from $C$ to $AB$, meeting at the point $D$. If the (absolute) length of $CD$ is more than half the width of the thick line then $C$ is outside the thick line (as shown in this particular case).

If the thick line is in fact a thick segment, then you also have to consider whether $D$ is between $A$ and $B$ (or perhaps slightly beyond one of them, if the thickness extends further).

-
Yes, you fully understand what I want. Can you help with a formula? –  Mediator Aug 27 '11 at 10:45
Assuming @Henry's picture summarizes the question asked, for a given thickness $T$ a necessary and sufficient condition is given by the following inequalities: $$0\le\overrightarrow{AC}\cdot\overrightarrow{AB}\le AB^2,\qquad\qquad AB^2AC^2\le T^2AB^2+\left(\overrightarrow{AC}\cdot\overrightarrow{AB}\right)^2.$$ The first condition ensures that the projection of $C$ on the line $(AB)$ lies between $A$ and $B$ and the second condition ensures that the distance between $C$ and the line $(AB)$ is at most $T$.
To prove this, note that $\overrightarrow{AC}$ must be $\overrightarrow{AC}=u\overrightarrow{AB}+t\overrightarrow{N}$ with $0\le u\le 1$, $t^2\le T^2$ and $\overrightarrow{N}$ a unitary vector orthogonal to $\overrightarrow{AB}$ and try to express the conditions on $u$ and $t$ in terms of $\overrightarrow{AC}$, $\overrightarrow{AB}$, their norms $AC$ and $AB$, and their scalar product $\overrightarrow{AC}\cdot\overrightarrow{AB}$ only.