二次作业3
来源:互联网 发布:java聊天室项目 编辑:程序博客网 时间:2024/06/05 18:44
package test;
public class Point {
double x ,y,Circle;
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);
}
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));
}
// 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));
}
}
阅读全文
0 0
- 二次作业3
- 第十二次课后作业
- 第十二次课后作业
- 第十二次课外作业
- 二次作业1
- 二次作业2
- 第十二次作业
- 我二次作业与感受
- 《算法概论》的二次作业之编程
- 我的第二次数据库作业,老师给了满分!!!
- geekband android #5 第十二次作业分析过程
- MapReduce数据倾斜解决方案2-- 自定义分区类---二次作业
- 作业:C++作业3
- 作业:C++作业3
- 作业:C++作业3
- MapReduce数据倾斜解决方案1--1、重新设计key---二次作业
- 作业3
- 作业3
- Tomcat原理详解及请求过程
- 87. Scramble String
- 命名空间,输入输出流,重载,缺省参数,引用和指针区别
- Learning Python Part II 之 迭代和推导式
- LinkedHashMap和TreeMap排序实现
- 二次作业3
- python中安装 tushare
- --如何用PhotoShop制作真人头像表情包--
- Selenium+PhantomJS QQ空间模拟登陆
- 挑战程序竞赛系列(77):4.3 2-SAT(1)
- 缩写总结
- 1036跟着奥巴马一起学编程(逻辑题)
- link exe error
- 成员函数的重载、覆盖、隐藏 和 虚函数