虫虫首页|资源下载|资源专辑|精品软件
登录|注册

perimeter

  • Evenly spaces the cities on the perimeter of a wheel and returns a vector of their coordinates 利用AI

    Evenly spaces the cities on the perimeter of a wheel and returns a vector of their coordinates 利用AI技术生成一个圆

    标签: coordinates perimeter the returns

    上传时间: 2016-11-18

    上传用户:dyctj

  • (1) 实现一个Point类

    (1) 实现一个Point类,该类包含表示坐标的两个int型变量x、y,构造方法Point()和Point(int xx, int yy),返回x值和y值的int getX()和int getY()方法,计算两点间距离的double distance(Point)方法。其中计算平方根用Math.sqrt()方法。 (2) 实现一个Circle类,该类包含表示圆心的Point型变量center,表示半径的int radius变量,以及构造方法Circle()、Circle(int xx,int yy,int r)、Circle(Point c,int r),返回周长和面积的int perimeter()、double area()方法,返回两个圆是否为同一个圆(返回0)、同心圆(返回1)、相交的圆(返回2)、分离的圆(返回3)、包含的圆(返回4)等关系的int relation(Circle c)等方法。PI值可以用Math.PI常量。 (3) 实现测试上述两个类的ClassTest类。该类在main方法中分别创建若干个Point对象和Circle对象,并调用相关方法,输出方法的返回值,验证其正确性。 (4) 将Point类、Circle类和主类的包名分别调整为p1、p2、p3,并重新运行,验证是否运行正确。

    标签: Point

    上传时间: 2014-11-25

    上传用户:cylnpy

  • Java code where user can enter the height and base of a triangle and the program will calculate the

    Java code where user can enter the height and base of a triangle and the program will calculate the area and perimeter if it is a right triangle

    标签: the and calculate triangle

    上传时间: 2013-12-05

    上传用户:yzhl1988