### Instruction: Find the distance from the point $(1,-1,2)$ to the line passing through $(-2,2,1)$ and $(-1,-1,3).$.### Response: To find the distance from a point to a line, I need to find the length of the perpendicular segment that joins them.
I can start by finding the direction vector of the line, which is the difference of the two given points: $(-1,-1,3) - (-2,2,1) = (1,-3,2).$
This means that any point on the line can be written as $(-2,2,1) + t(1,-3,2)$ for some scalar $t$.
I can use this parametric form to find the point on the line that is closest to $(1,-1,2)$, which will be the foot of the perpendicular segment.
To do that, I can use the dot product formula, which says that two vectors are perpendicular if and only if their dot product is zero.
Let $P = (-2,2,1) + t(1,-3,2)$ be the point on the line that is closest to $(1,-1,2)$. Then the vector joining them is $(1,-1,2) - P = (1,-1,2) - (-2,2,1) - t(1,-3,2) = (3,-3,1) - t(1,-3,2).$
I want this vector to be perpendicular to the direction vector of the line, which is $(1,-3,2)$. So I need to solve $(3,-3,1) - t(1,-3,2) \cdot (1,-3,2) = 0.$
Expanding the dot product, I get $(3,-3,1) \cdot (1,-3,2) - t((1,-3,2) \cdot (1,-3,2)) = 0.$
Simplifying, I get $3 + 9 + 2 - t(1 + 9 + 4) = 0.$
Solving for $t$, I get $t = \frac{14}{14} = 1.$
This means that the point on the line that is closest to $(1,-1,2)$ is $P = (-2,2,1) + (1,-3,2) = (-1,-1,3).$
Now I can find the distance between them by using the distance formula. The distance is $\sqrt{(1 - (-1))^2 + (-1 - (-1))^2 + (2 - 3)^2} = \sqrt{4 + 0 + 1} = \sqrt{5}.$