Derive The Distance Formula