The hypotenuse of a right angled triangle has its ends at the points (1, 3) and (-4, 1). Find the equation of the legs (perpendicular sides) of the triangle.