Function distance2d

Calculates the Euclidean distance between two points.