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
|
class IGPPentagon extends IGPFamily{
IGPPentagon(float x, float y, float d){
super(x, y, d);
setVectorsOnAlphaCircle();
setConstructionCircleCenters();
}
void setConstructionCircleCenters(){
constructionCircleCenters = new ArrayList <PVector> (5);
constructionCircleCenters.add(getVectorOnAlphaCircle(342));
constructionCircleCenters.add(getVectorOnAlphaCircle(54));
constructionCircleCenters.add(getVectorOnAlphaCircle(126));
constructionCircleCenters.add(getVectorOnAlphaCircle(198));
constructionCircleCenters.add(getVectorOnAlphaCircle(270));
}
void createInnerPentagon(){
stroke(0.0, 0.0, 0.66, 0.4);
beginShape(LINES);
vertex(constructionCircleCenters.get(0).x, constructionCircleCenters.get(0).y);
vertex(constructionCircleCenters.get(1).x, constructionCircleCenters.get(1).y);
vertex(constructionCircleCenters.get(1).x, constructionCircleCenters.get(1).y);
vertex(constructionCircleCenters.get(2).x, constructionCircleCenters.get(2).y);
vertex(constructionCircleCenters.get(2).x, constructionCircleCenters.get(2).y);
vertex(constructionCircleCenters.get(3).x, constructionCircleCenters.get(3).y);
vertex(constructionCircleCenters.get(3).x, constructionCircleCenters.get(3).y);
vertex(constructionCircleCenters.get(4).x, constructionCircleCenters.get(4).y);
vertex(constructionCircleCenters.get(4).x, constructionCircleCenters.get(4).y);
vertex(constructionCircleCenters.get(0).x, constructionCircleCenters.get(0).y);
endShape();
}
void createDividingLines(){
stroke(0.0, 0.66, 0.0, 0.4);
createLine(mid, constructionCircleCenters.get(0));
createLine(mid, constructionCircleCenters.get(1));
createLine(mid, constructionCircleCenters.get(2));
createLine(mid, constructionCircleCenters.get(3));
createLine(mid, constructionCircleCenters.get(4));
}
void display() {
super.display();
createInnerPentagon();
createDividingLines();
}
void displayConstructionLines(){
super.displayConstructionLines();
createConstructionCircles();
}
}
|