Refactor Class + Variable Names
parent
3bf3458c82
commit
e043348ffd
@ -1,8 +1,8 @@
|
|||||||
public class Coords {
|
public class Coordinates {
|
||||||
private int x;
|
private int x;
|
||||||
private int y;
|
private int y;
|
||||||
|
|
||||||
public Coords(int x, int y) {
|
public Coordinates(int x, int y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
}
|
}
|
@ -1,12 +1,12 @@
|
|||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
Coords p1 = new Coords(4, 16);
|
Coordinates coordinate1 = new Coordinates(4, 16);
|
||||||
Coords p2 = new Coords(2, 8);
|
Coordinates coordinate2 = new Coordinates(2, 8);
|
||||||
|
|
||||||
Line myLine = new Line(p1, p2);
|
Line line = new Line(coordinate1, coordinate2);
|
||||||
|
|
||||||
myLine.calculateGradient();
|
line.calculateGradient();
|
||||||
myLine.calculateIntercept();
|
line.calculateIntercept();
|
||||||
myLine.displayEquation();
|
line.displayEquation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue