-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscaleVisualizer.pde
More file actions
50 lines (41 loc) · 1.19 KB
/
Copy pathscaleVisualizer.pde
File metadata and controls
50 lines (41 loc) · 1.19 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
PVector[] vertice1 = new PVector[360];
PVector[] vertice2 = new PVector[360];
float xPos;
float yPos;
int deg = 0;
class scaleVisualizer{
scaleVisualizer(float _xPos, float _yPos){
xPos = _xPos;
yPos = _yPos;
}
void show(int _c){
float multp = 100;
for (int i = 0; i< vertice1.length;i++){
vertice1[i] = new PVector(xPos + (cos(radians(91+i)) * multp),
yPos + (sin(radians(91+i)) * multp));
vertice2[i] = new PVector(xPos + (cos(radians(91+i - 2)) * multp),
yPos + (sin(radians(91+i - 2)) * multp));
}
noStroke();
fill(_c);
for (int i = 0; i< deg;i++){
triangle(xPos, yPos, vertice1[i].x, vertice1[i].y, vertice2[i].x, vertice2[i].y);
}
// inner circle
noStroke();
fill(#2c1752);
ellipse(xPos, yPos, 130, 130);
noFill();
stroke(#2c1752);
strokeWeight(6);
//border
ellipse(xPos, yPos, 200, 200);
stroke(#e3e6ff);
strokeWeight(7);
fill(#e3e6ff);
arc(xPos, yPos, 200, 200, 0, PI);
}
void updateDegree(int _deg){
deg = _deg;
}
}