求教两点坐标距离问题
计算(x1, y1)和(x2, y2)两点之间的距离。所有的数和返回值都应该是double类型的。
distance
public static double distance(double x1, double y1, double x2, double y2)
- Returns the distance between two points.
- Parameters:
x1
- the X coordinate of the first specified pointy1
- the Y coordinate of the first specified pointx2
- the X coordinate of the second specified pointy2
- the Y coordinate of the second specified point- Returns:
- the distance between the two sets of specified coordinates.
- Since:
- 1.2