用java.awt.geom.Point2D的distance方法:
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





2007-5-23 17:33 


