From 975abd0e19aea203ac06ba751b5abf3b35e95f18 Mon Sep 17 00:00:00 2001 From: HORVILLE Ewen Date: Tue, 15 Feb 2022 11:26:26 +0100 Subject: [PATCH] Java --- APL2.1/TP04/Segment/Segment.class | Bin 0 -> 1039 bytes APL2.1/TP04/Segment/Segment.java | 42 + APL2.1/TP04/Segment/TestSegment.class | Bin 0 -> 499 bytes APL2.1/TP04/Segment/TestSegment.java | 8 + APL2.1/TP04/segment.mdj | 752 ++ APL2.1/TP04/site web.mdj | 2820 +++++ APL2.1/TP04/transports.mdj | 9290 +++++++++++++++++ APL2.1/TP04/voiture.mdj | 3054 ++++++ APL2.1/{TP04 => TP05}/Date/Date.class | Bin APL2.1/{TP04 => TP05}/Date/Date.java | 0 APL2.1/{TP04 => TP05}/Date/MyDate.class | Bin APL2.1/{TP04 => TP05}/Date/MyDate.java | 0 .../Lendemains/Lendemains.class | Bin .../{TP04 => TP05}/Lendemains/Lendemains.java | 0 APL2.1/{TP04 => TP05}/Lendemains/MyDate.class | Bin APL2.1/{TP04 => TP05}/Lendemains/MyDate.java | 0 APL2.1/{TP04 => TP05}/Periode/MyDate.class | Bin APL2.1/{TP04 => TP05}/Periode/MyDate.java | 0 APL2.1/{TP04 => TP05}/Periode/MyPeriod.class | Bin APL2.1/{TP04 => TP05}/Periode/MyPeriod.java | 0 APL2.1/{TP04 => TP05}/Periode/Periode.class | Bin APL2.1/{TP04 => TP05}/Periode/Periode.java | 0 .../{TP04 => TP05}/Progression/Compteur.class | Bin .../{TP04 => TP05}/Progression/Compteur.java | 0 .../Progression/Progression.class | Bin .../Progression/Progression.java | 0 26 files changed, 15966 insertions(+) create mode 100644 APL2.1/TP04/Segment/Segment.class create mode 100644 APL2.1/TP04/Segment/Segment.java create mode 100644 APL2.1/TP04/Segment/TestSegment.class create mode 100644 APL2.1/TP04/Segment/TestSegment.java create mode 100644 APL2.1/TP04/segment.mdj create mode 100644 APL2.1/TP04/site web.mdj create mode 100644 APL2.1/TP04/transports.mdj create mode 100644 APL2.1/TP04/voiture.mdj rename APL2.1/{TP04 => TP05}/Date/Date.class (100%) rename APL2.1/{TP04 => TP05}/Date/Date.java (100%) rename APL2.1/{TP04 => TP05}/Date/MyDate.class (100%) rename APL2.1/{TP04 => TP05}/Date/MyDate.java (100%) rename APL2.1/{TP04 => TP05}/Lendemains/Lendemains.class (100%) rename APL2.1/{TP04 => TP05}/Lendemains/Lendemains.java (100%) rename APL2.1/{TP04 => TP05}/Lendemains/MyDate.class (100%) rename APL2.1/{TP04 => TP05}/Lendemains/MyDate.java (100%) rename APL2.1/{TP04 => TP05}/Periode/MyDate.class (100%) rename APL2.1/{TP04 => TP05}/Periode/MyDate.java (100%) rename APL2.1/{TP04 => TP05}/Periode/MyPeriod.class (100%) rename APL2.1/{TP04 => TP05}/Periode/MyPeriod.java (100%) rename APL2.1/{TP04 => TP05}/Periode/Periode.class (100%) rename APL2.1/{TP04 => TP05}/Periode/Periode.java (100%) rename APL2.1/{TP04 => TP05}/Progression/Compteur.class (100%) rename APL2.1/{TP04 => TP05}/Progression/Compteur.java (100%) rename APL2.1/{TP04 => TP05}/Progression/Progression.class (100%) rename APL2.1/{TP04 => TP05}/Progression/Progression.java (100%) diff --git a/APL2.1/TP04/Segment/Segment.class b/APL2.1/TP04/Segment/Segment.class new file mode 100644 index 0000000000000000000000000000000000000000..2af77ee0abaacbdf90bcc8c2d8b09ee046a701d4 GIT binary patch literal 1039 zcmZuv?QYUg7=8{d6l#HuZ90KDHa0CVhjV`X(C8A;goLRH#zg-WXpqTZgW~iGyp#FI z#F&h1(ZmbzqKwZu?K0hH)ARA3_dFl(+uwhF`~q+v_e{jG6oZ9jIphtjn9#8r<8VE) z#T@yVxB**+3UXC6P%^M45FUEYz!R9N?KmHtvUA{-U-mma?}32k_F4jwhn-%>dnAyz z&!?Q<7hVhKPx>uaAX)45+~=d+hC6uWG`fr!c9oAziFDmw+j~a>yHF8`4qdPAi&I=y!JMPtWpvXC@I z&Eg}!>M5>D*mjiXz5ao;RH;bs;u9-2+?Nf|ZAP%f2FBT~5MQcOD+=Tsg`lVu#~JQ6 zd9HCz7LOr{r7=RqwK25s3<=C~OtI5|!7+*$-voaE2{0D`R1oG1!lW~wftOU#>9prBWm6?`InX#`UJBE37HK9tEW@R$$ zewG(Alj;6(@6#=kE~oM*(P;slHi<4zx)su`@_H5vf!fD`yR1}O;&+IYtQ42pAq@Qs cbnPpBhE!Ai`q;R}NEo5?7XKjjK_2J+0!!AMi2wiq literal 0 HcmV?d00001 diff --git a/APL2.1/TP04/Segment/Segment.java b/APL2.1/TP04/Segment/Segment.java new file mode 100644 index 0000000..75450e4 --- /dev/null +++ b/APL2.1/TP04/Segment/Segment.java @@ -0,0 +1,42 @@ +import java.awt.Point; + +public class Segment { + private Point start; + private Point end; + + public Segment(Point p1, Point p2) { + start = p1; + end = p2; + } + + public Segment(int x1, int y1, int x2, int y2) { + start = new Point(x1, y1); + end = new Point(x2, y2); + } + + public double length() { + return Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2)); + } + + public void setStart(Point p) { + start = p; + } + + public void setStart(int x, int y) { + start.x = x; + start.y = y; + } + + public void setEnd(Point p) { + end = p; + } + + public void setEnd(int x, int y) { + end.x = x; + end.y = y; + } + + public boolean equals(Segment s2) { + return this.start == s2.start && this.end == s2.end; + } +} \ No newline at end of file diff --git a/APL2.1/TP04/Segment/TestSegment.class b/APL2.1/TP04/Segment/TestSegment.class new file mode 100644 index 0000000000000000000000000000000000000000..4fbbecd0d0676ddbf909e69901264f2d32908994 GIT binary patch literal 499 zcmY*W+fKqj5Ix%#Dy3=#!5gTkiA9Y(`hfAp#Kfdtk`fZ}X~7LC=|!P6@w4;+5>5O7 zKgu|ZB)~rG%$%M%b7uSV`}qyv3e?GvH}+zT0s_M_9|ue|2-uv>HEz87}uve9s(q~8%& zo+MihF^FB!4MZ59O1g;*3