/*标签:p2,此小,p1,Point,double,坐标,y1,x1,输入 From: https://blog.51cto.com/javaalpha/5892793
* 此小程序用于输入两个坐标,输出他们之间的距离
* 2009年5月5日20:30:31
* author: Alpha
*/
public class Point
{
double x;
double y; Point()
{
} Point(double x, double y)
{
this.x = x;
this.y = y;
}
public static int getDistence(Point p1, Point p2)
{
double x1,y1;
x1 = p2.x-p1.x;
y1 = p2.y-p2.y;
return (int) Math.sqrt(x1*x1+y1*y1);
} public static void main(String[] args)
{
Point p = new Point();
Point p1 = new Point(20, 30);
Point p2 = new Point(40, 60);
System.out.println("p1到p2之间的距离是:"+lang);
}
}