forked from srinathr91/TestJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLine.java
More file actions
53 lines (43 loc) · 855 Bytes
/
Line.java
File metadata and controls
53 lines (43 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
public class Line{
private float a,b,c,m,mp;
private float x_start,y_start;
private float x_end,y_end;
public void Line(float x_start,float y_start,float x_end,float y_end){
this.x_start=x_start;
this.y_start=y_start;
this.x_end=x_end;
this.y_end=y_end;
a=x_end-x_start;
b=y_start-y_end;
c=(y_start*x_end)-(x_start*y_end);
m=(y_end-y_start)/(x_end-x_start);
mp=(-1)/(m);
}
public float getA() {
return a;
}
public float getB() {
return b;
}
public float getC() {
return c;
}
public float getM() {
return m;
}
public float getMp() {
return mp;
}
public float getX_start() {
return x_start;
}
public float getY_start() {
return y_start;
}
public float getX_end() {
return x_end;
}
public float getY_end() {
return y_end;
}
}