1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| public class Point {
private double x,y;
public Point(double x, double y){
this.x=x;
this.y=y;
}
public double getX(){
return x;
}
public double getY(){
return y;
}
public String toString(){
return "("+x+","+y+")";
}
public class Polygone {
protected Point[] sommets;
public Polygone(double[] x, double[] y){
this.x=x;
this.y=y;
for (int i = 0; i < x.length; i++){
this.points[i] = new Point(x[i], y[i]);
}
}
protected Polygone(int nbrSommets){
this.sommets = new Point[nbrSommets];
this.nbrSommets = nbrSommets;
}
public Point getSommet(int i){
return this.sommets[i];
}
public double aire(){
}
public String toString(){
}
public class Rectangle extends Polygone {
public Rectangle(double xMin, double xMax, double yMin, double yMax) {
}
public class Triangle extends Polygone {
public Triangle (Point a, Point b, Point c){
}
}
public class PolygoneRegulier extends Polygone {
public PolygoneRegulier (Point c, Point P, int nombreSommets){
}
}
class TestPolygone
{
public static void main(String[] args)
{
}
} |
Partager