At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I'm borrowing this answer from another post, but it is completely correct. :)
Here's one way to think about it. Let's call the points A (-1,2), B (-10,5), and C (-4, k). If these three points are to make a right triangle, then that triangle must have a hypotenuse. There are only three possibilities for the hypotenuse: the line AB, the line BC, or the line AC. If AB is the hypotenuse, then AC and CB are the legs. If BC is the hypotenuse, then AB and AC are the legs. If AC is the hypotenuse, then AB and BC are the legs. In order for these sides to make up a right triangle, the sides of the triangle must satisfy the Pythagorean theorem. Since you know the coordinates of the points A, B, and C, you can use the distance formula (actually, the square of the distance, since that is what enters into the Pythagorean theorem) to write three sets of equations (one for each of the possibilities), then solve those equations for k. I'll do one of them and leave the two others to you: Let AC be the hypotenuse. Then: (AB)^2 is (-1-(-10))^2 +(2-5)^2 (BC)^2 is (-10-(-4))^2 + (5-k)^2 (AC)^2 is (-1-(-4))^2 + ((2-k)^2 Use the Pythagorean formula for this triangle to find that k = 23. In the second case, you again get a linear equation for k, and find that k = -7. In the third case, you get a quadratic equation for k, and find that k = 8 or k = -1. So the possible values of k are -1, -7, 8, or 23. Another approach would be to say that since the triangle is supposed to be a right triangle, the legs should be perpendicular. Since you can find the slopes of each of the lines which make up those legs, the demand that the lines be perpendicular (that the product of their slopes be -1) would again give you equations to solve for k.