summaryrefslogtreecommitdiffstats
path: root/AutoVisual/IGPPentagon.pde
blob: 881adca4c4a7796cb4338576329006d126a9d742 (plain)
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
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 display() {
    super.display();
    createInnerPentagon();
  }
  void displayConstructionLines(){
    super.displayConstructionLines();
    createConstructionCircles();
  }
}