Vector distance with tuples in Scala