double radius;
String drawingName="Circle";
circle(mpoint p1,double radius){
this.p1=p1;
this.radius=radius;
}
public double getArea(){
double ssa;
ssa=Math.PI*radius*radius;
return ssa;
}
public double getCircum(){
return Math.PI*2.0*radius;
}
public String getName(){
return drawingName;
}
public boolean tcircle(){
return true;
}
}
// class rectangle
class rectangle implements getProperty {
mpoint p1,p2;
double s1,s2;
String drawingName="Rectangle";
rectangle(mpoint p1,mpoint p2){
this.p1=p1;
this.p2=p2;
this.s1=Math.sqrt( (p1.x-p2.x)*(p1.x-p2.x) ); this.s2=Math.sqrt( (p1.y-p2.y)*(p1.y-p2.y) ); }
public double getArea(){
return s1*s2;
}
public double getCircum(){
return s1+s2+s1+s2;
}
public String getName(){
return drawingName;
}
public boolean rline(){
return true;