Guest User

Untitled

a guest
Jan 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1.  
  2. public class Graphique2D {
  3.  
  4.     /**
  5.      * @param args the command line arguments
  6.      */
  7.     public static void main(String[] args) {
  8.  
  9.         // Création de point
  10.         Point p;
  11.         p = Point.creerPt();
  12.         // Déplacer un point
  13.         System.out.println("Entrer décalage abscisse");
  14.         float dx=Lire.f();
  15.         System.out.println("Entrer décalage ordonnée");
  16.         float dy=Lire.f();
  17.         p.deplacer(dx, dy);
  18.         System.out.println("Nouvelles coordonnées");
  19.         p.afficher();
  20.  
  21.         // Créer un segment
  22.         Segment S;
  23.         S = Segment.creerS();
  24.  
  25.         // Demander longueur segment
  26.         double l;
  27.         l = S.longueur();
  28.         System.out.println( "Longueur du segment : " + l);
  29.  
  30.  
  31.         // Créer une polyligne
  32.         Polyligne Pl;
  33.         Pl = Polyligne.creerPl();
  34.  
  35.  
  36.         // Créer un polygone
  37.       //  Polygone Pg;
  38.        // Pg = Polygone.creerPg();
  39.  
  40.         // Demander longueur polyligne
  41.         double L;
  42.         L = Pl.longueurPoly();
  43.         System.out.println("Longueur de la polyligne : "+ L);
Add Comment
Please, Sign In to add comment