remember the distance formula ? distance of the point (x,y) from the origin is ...

substitute for

let

if z is maximized/minimized, so is d ...

will yield a minimum distance

the endpoints, and , will be maximums ... calculate which yields the absolute maximum distance.