One of the endpoint is clearly #C(2,2)#, while other say #D# will lie on #AB#. It is apparent that #CD# and #AB# are perpendicular to each other.
Hence product of their slopes #m_(AB)# and #m_(CD)# would be #-1# and solving for equations of line #AB# and #CD# will give us coordinates of #D#.
Let us first find the equation of #AB#. As it's slope is given by #m_(AB)=(4-1)/(3-1)=3/2# and equation of #AB# using point slope form of equation, would be
#y-1=3/2(x-1)# i.e. #2y-2=3x-3# or #3x-2y=1# .............(1)
Now slope of #CD# is given by #m_(CD)=(-1)/m_(AB)=(-1)/(3/2)=-2/3#
and as #CD# passes through #C(2,2)#, its equation is
#y-2=-2/3(x-2)# or #3y-6=-2x+4# or
#2x+3y=10# ...........(2)
For Solving equations (1) and (2), let us multiply equation (1) by #3# and (2) by #2# and adding them we get
#9x-6y+4x+6y=3+20# or #13x=23# and hence #x=23/13#
Putting this in (2), we get #2xx23/13+3y=10# or #3y=10-46/13=84/13#
i.e. #y=28/13#
and hence coordinates of #D# are #(23/13,28/13)#
So endpoints of perpendicular bisector are #D(23/13,28/13)# and #C(2,2)# and length of altitude is
#sqrt((2-23/13)^2+(2-28/13)^2)=sqrt((3/13)^2+(-2/13)^2)#
= #sqrt(9/169+4/169)=sqrt13/13#