import java.awt.geom.Point2D;
class diastcomput {
public static void main (String args[]) {
Point2D.Double p1=new Point2D.Double(2779404.96,374361.55);
Point2D.Double p2=new Point2D.Double(2780364.19,372490.97);
Point2D.Double p3=new Point2D.Double(371679.98,2781665.63);
Point2D.Double p4=new Point2D.Double(2781484.36,371549.16);
Point2D.Double p5=new Point2D.Double(2782161.45,371901.26);
System.out.println("p1到P2距離: "+ p1.distance(p2));
System.out.println("p2到P3距離: "+ p2.distance(p3));
System.out.println("p3到P4距離: "+ p3.distance(p4));
System.out.println("p4到P5距離: "+ p4.distance(p5));
System.out.println("p5到P6距離: "+ p5.distance(p2));
}
}
沒有留言:
張貼留言