It is the magnitude of vector. Pythagorean theorem. Vector divided by its magnitude is a unit vector whose norm is equal to 1. Just point in the direction of the vector like i,j and k points in x,y and z direction.
The xt is from the vector that you get from subrtacting the points (slope) and the you add the point coordinates for height. For p x and y = 0 and z = 4