public class Point {
double x,y;
public Point(double x, double y){
this.x = x;
this.y = y;
}
}
public class Circle {
Center point;
double radius;
public Circle(Center Point, Double Radius){
this.center=center;
this.radius=radius;
}
}
public class Circle {Output
Center point;
static double radius;
public Circle(Center Point, Double Radius){
this.center=center;
this.radius=radius;
}
static double getDiametre(){
return radius*2;
}
static double getLength(){
return 2*3.14*radius;
}
static double getSurface(){
return 3.14*Math.pow(radius, 2);
}
static double getLengthArc(double alpha){
return 3.14*alpha;
}
public static void main(String[] args) {
Circle = new Circle(new Point(0, 0), 8);
System.out.println("Diameter: "+Circle.getDiameter());
System.out.println("Length: "+Circle.getLength());
//arc length with an angle of 55 radians
double alpha = 55;
System.out.println("Arc Length: "+Circle.getArcLength(55));
System.out.println("Surface: "+Circle.getSurface());
}
}
Diameter: 16.0
Perimeter: 50.24
Arc length: 172.700000000000002
Area: 200.96
Please disable your ad blocker and refresh the window to use this website.