You can’t do this directly because Point.Stride only conforms to Comparable and SignedNumeric, neither of which give you divide. I would solve this by requiring that the stride conform to BinaryInteger [1]:

func findMiddleBetweenTwo<Point: Strideable>(left: Point, right: Point) -> Point where
Point.Stride: BinaryInteger
{
let distance = left.distance(to: right)
let half = distance / 2
return left.advanced(by: half)
}

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

[1] Or FloatingPoint, depending on what you’re using this for.