Find the value of the constant t such that the triangle formed by A (2,2) ,B (4,-5) ,C (6,t) is right angled at B(4,-5).

Line passing through two given points P1(x1,y1) and P2(x2,y2)

L: (y-y1)/(y2-y1) = (x-x1)/(x2-x1)
or (x2-x1)(y-y1) = (y2-y1)(x-x1)

For line AB:
AB: (4-2)(y-2) = (-5-2)(x-2)
=> AB: 2(y-2) = (-7)(x-2)
=> AB: y = -3.5x + 9

Similarly, line BC is:
BC: (6-4)*(y+5)=(t+5)*(x-4)
=> BC: y=((t+5)/2)x - 2t-15
If the two lines are to be perpendicular to each other, the product of the slopes must be -1, or
-3.5*(t+5)/2 = -1
Solve for t to get t=-31/7

Check:
Slope of AB: (-5-2)/(4-2)=-3.5
Slope of BC: (-31/7+5)/(6-4)= 2/7
Product of slopes : -3.5*2/7=-1 OK