/* Une classe application de test de l'algorithme */ /* de Cohen-Sutherland */ /* */ /* Auteur: Nicolas JANEY */ /* nicolas.janey@univ-fcomte.fr */ /* Novembre 2009 */ public class CohenSutherland { public static void main(String [] args) { Segment s = new Segment(new Position2D(1.0F,2.0F), new Position2D(8.0F,6.0F)); Rectangle r = new Rectangle(new Position2D(2.0F,3.0F), new Position2D(6.0F,5.0F)); Segment sc = r.clip(s); if ( sc != null ) System.out.println(sc); } }