Given 4 parameters (x1, y1, x2, y2)
When x1 = 0, y1 = 0, x2 = 1, y2 = 0
Expect return 1;
When x1 = 0, y1 = 0, x2 = 0, y2 = 1
Expect return 1;
When x1 = 0, y1 = 0, x2 = 1, y2 = 1
Expect return Math.sqrt(2);
When x1 = 3, y1 = 2, x2 = 7, y2 = 7
Expect return Math.sqrt(41);
When x1 = -3, y1 = -2, x2 = 7, y2 = 7
Expect return Math.sqrt(181);
Add any other context, links references or screenshots about the feature request here.
Description
Give two points(x, y),
need a way to get distances
Additional context
Add any other context, links references or screenshots about the feature request here.
Important Checklist