Since the given three points already form a right angle, then the fourth vertex of the rectangle must be vertically above the point (5,1) and horizontally to the right of (1,7). Therefore, the x-coordinate of the fourth vertex is 5 and the y-coordinate is 7. Thus, the coordinates of the fourth vertex are (5,7).