34 lines
882 B
Java
34 lines
882 B
Java
public class DroiteTest {
|
|
public static void main(String[] args) {
|
|
Point p1 = new Point(1, 1);
|
|
Point p2 = new Point(5, 3);
|
|
Point p3 = new Point(0, 4);
|
|
Point p4 = new Point(4, 6);
|
|
|
|
Droite d1 = new Droite(0, 1, 2);
|
|
System.out.println(d1);
|
|
|
|
Droite d2 = Droite.create(p1, p2);
|
|
Droite d3 = Droite.create(p3, p4);
|
|
System.out.println(d2);
|
|
System.out.println(d3);
|
|
|
|
if(d2.isHorizontal())
|
|
System.out.println("d2 is horizontal");
|
|
if(d3.isHorizontal())
|
|
System.out.println("d3 is horizontal");
|
|
|
|
Point int1 = d1.intersection(d2);
|
|
if(int1 == null)
|
|
System.out.println("d1 et d2 sont paralleles ou confondues");
|
|
|
|
Point int2 = d1.intersection(d3);
|
|
if(int2 == null)
|
|
System.out.println("d1 et d3 sont paralleles ou confondues");
|
|
|
|
Point int3 = d2.intersection(d3);
|
|
if(int3 == null)
|
|
System.out.println("d2 et d3 sont paralleles ou confondues");
|
|
}
|
|
}
|