Distance Formula and Cartesian Form