This repository was archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocRet.java
More file actions
89 lines (76 loc) · 1.97 KB
/
Copy pathLocRet.java
File metadata and controls
89 lines (76 loc) · 1.97 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
public class LocRet {
private double relx;
private double rely;
private int numPlay;
private double[] rel = new double[2];
private double cenX;
private double cenY;
private int iter = 0;
public LocRet(int numPlay){
this.numPlay = numPlay;
}
public void LocIn(double x,double y)
{
relx = x;
rely = y;
}
public void setCen(double[][] cords)
{
cenX = cords[iter][1];
cenY = cords[iter][1];
}
public void upCen()
{
iter++;
}
public void reset()
{
iter=0;
}
public double LocPlX(int i)
{
double retx;
switch (i) {
case 1 -> retx = relx;
case 2 -> retx = rely;
case 3 -> retx = -relx;
case 4 -> retx = -rely;
case 5 -> retx = relx;
case 6 -> retx = rely;
case 7 -> retx = -relx;
case 8 -> retx = -rely;
default -> retx = relx;
}
return retx;
}
public double LocPlY(int i)
{
double rety;
switch (i) {
case 1 -> rety = rely;
case 2 -> rety = relx;
case 3 -> rety = rely;
case 4 -> rety = relx;
case 5 -> rety = -rely;
case 6 -> rety = -relx;
case 7 -> rety = -rely;
case 8 -> rety = -relx;
default -> rety = rely;
}
return rety;
}
public double LocCirX(int i)
{
double retx;
double newang = ((2*Math.PI) * ((i-1)/numPlay)) + CircleHelp.retA(relx,rely,cenX,cenY);
retx = CircleHelp.PtoCX(CircleHelp.retR(relx,rely,cenX,cenY),newang,cenX);
return retx;
}
public double LocCirY(int i)
{
double rety;
double newang = ((2*Math.PI) * ((i-1)/numPlay)) + CircleHelp.retA(relx,rely,cenX,cenY);
rety = CircleHelp.PtoCY(CircleHelp.retR(relx,rely,cenX,cenY),newang,cenY);
return rety;
}
}