Let be a line given by A + tB and let P be a point on different from A. For point Q not on , show that the distance d of Q form the line is given by:

d = |(P-A) × B| / |B|

To find the distance of point Q from the line defined by A + tB, we need to find the shortest distance between the point and the line.

Step 1: Find the vector representing the line
The vector representing the line is given by B.

Step 2: Find the vector from point A to point Q
Let's call this vector PQ. It can be obtained by subtracting the coordinates of point A from the coordinates of point Q:
PQ = Q - A

Step 3: Find the projection of PQ onto the line vector B
The projection of PQ onto B is given by the dot product of PQ and B divided by the magnitude of B:
projB(PQ) = (PQ • B) / |B|

Step 4: Find the vector perpendicular to the line vector B
The vector perpendicular to B is given by the cross product of B with the unit vector in the direction of B:
perpB = cross(B / |B|, vector(0, 0, 1))

Step 5: Find the projection of PQ onto the perpendicular vector perpB
The projection of PQ onto perpB is given by the dot product of PQ and perpB divided by the magnitude of perpB:
projPerpB(PQ) = (PQ • perpB) / |perpB|

Step 6: Calculate the distance d
Finally, the distance d of point Q from the line is given by the magnitude of the projection of PQ onto the perpendicular vector perpB:
d = |projPerpB(PQ)|

So, the distance d of point Q from the line defined by A + tB is given by:
d = |(PQ • perpB) / |perpB||