Wave Distance Formula