-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.java
More file actions
44 lines (37 loc) · 723 Bytes
/
Point.java
File metadata and controls
44 lines (37 loc) · 723 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
package Components;
import java.util.*;
import java.awt.*;
public class Point { //makes it available throughout classes
public float x;
public float y;
public int label;
int min = 0;
int max = 800;
Random r = new Random();
public Point(){
x = min + r.nextFloat() * (max - min);
y = min + r.nextFloat() * (max - min);
if(x>y){
label = 1; //points above trend line of x>y
}
else{
label = -1; //points below trend line
}
}
public float getX(){
return x;
}
public float getY(){
return y;
}
// public void show(){
// stroke(0);
// if(label ==1 ){
// fill(255);
// }
// else{
// fill(0);
// }
// ellipse(x,y,8,8);
// }
}