One possibility for computing segment interval