Q:

How to check if point is in line shadow

I can't really figure out how exactly to phrase this question, so I made a crude graphic explaining what I'm trying to ask: 
Given a line comprised of two points, how would I go about checking if a given point was within the area relative to the line as displayed in the image? Sorry if there is a term for this that I didn't know.

A:

Assuming your line segment points are p1 and p2, and your query point is q:

Compute the line segment length b := |p2 - p1| and line direction (normalized) z := (p2 - p1) / b and 
Compute the vector from p1 to q, defined as w := (q - p1).
Project the query point onto the infinite line by computing q' := w dot z. This gives you the position of the point as if it moved to the line via an orthogonal path from its original position.
Inspect q: If q > b then your query point is outside of the line segment shadow, past p2. If q < 0 then your query point is outside of the line segment shadow, past p1. Otherwise, q is "inside".

