Distance Formula in 3 Dimensions