
See the image above; basically, I want a simple test to check if a point is within the line se
I took Daniel Fischer answer which is great, and adjusted it for 3D and Unity:
public bool InSegmentRange(Vector3 start, Vector3 end, Vector3 point) {
Vector3 delta = end - start;
float innerProduct = (point.x - start.x) * delta.x + (point.y - start.y) * delta.y + (point.z - start.z) * delta.z;
return innerProduct >= 0 && innerProduct <= delta.x * delta.x + delta.y * delta.y + delta.z * delta.z;
}