Given,
A line passes through A(4,−6,−2) and B(16,−2,4),
So, the equation of line will be 12x−4=4x+6=6z+2
⇒6x−4=2x+6=3z+2
So, the direction cosines will be 62+22+326,62+22+322,62+22+323
≡76,72,73
Now, given point P(a,b,c) lies on the line AB and at a distance of 21 from point A
So, by using the equation of line AB we get,
⇒76a−4=72b+6=73c+2=21
⇒(21×76+4,72×21−6,73×21−2)≡(a,b,c)
⇒(22,0,7)≡(a,b,c)
Hence, the distance between P(22,0,7)&Q(4,-12,3) is given by, 324+144+16=22