package test;
public class Point {
    double x ,y,Circle;
    public Point() {
 this.x=1.0;
 this.y=2.0;
 this.Circle=3.0;
 }
   
 public Point(double x, double y, double circle) {
  this.x = x;
  this.y = y;
  Circle = circle;
 }
 public boolean overlap(Point p) {
        return Math.sqrt((p.x-this.x)*(p.x-this.x)+(p.y-this.y)*(p.y-this.y))<(p.Circle+this.Circle);
    }
 public static void main(String[] args) {
  // TODO Auto-generated method stub
    Point c1=new Point();
    Point c2=new Point(3.0,4.0,5.0);
    System.out.println(c1.overlap(c2));
 }
}二次作业3

相关文章:

  • 2021-06-29
  • 2021-08-16
  • 2021-08-24
  • 2021-09-18
猜你喜欢
  • 2021-07-15
  • 2022-01-11
相关资源
相似解决方案