diff options
author | David Runge <dave@sleepmap.de> | 2016-01-05 17:50:21 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-01-05 17:50:21 +0100 |
commit | ee768491111ae54e4a9f39a3a8c261071f935a3d (patch) | |
tree | cade19d8bb63563078e4f86037da8a1e14079600 | |
parent | a8e04aa27c0eb30c309c591b8a8548e22b28de90 (diff) | |
download | processing-sketchbook-ee768491111ae54e4a9f39a3a8c261071f935a3d.tar.gz processing-sketchbook-ee768491111ae54e4a9f39a3a8c261071f935a3d.tar.bz2 processing-sketchbook-ee768491111ae54e4a9f39a3a8c261071f935a3d.tar.xz processing-sketchbook-ee768491111ae54e4a9f39a3a8c261071f935a3d.zip |
AutoVisual/IGPTheGreatMosqueOfCordoba.pde: Adding setVectorsOnOuterSquare() function. Getting all PVectors for calculations from previously created lists, to save calculation time. Moving all stroke drawing to displayConstructionLines(). Also setting the PVector indicators on the outer square for better visibility. Aligning stroke and fill color with IGPTheGreatMosqueOfKairouan.
-rw-r--r-- | AutoVisual/IGPTheGreatMosqueOfCordoba.pde | 262 |
1 files changed, 144 insertions, 118 deletions
diff --git a/AutoVisual/IGPTheGreatMosqueOfCordoba.pde b/AutoVisual/IGPTheGreatMosqueOfCordoba.pde index df4e8ed..3143962 100644 --- a/AutoVisual/IGPTheGreatMosqueOfCordoba.pde +++ b/AutoVisual/IGPTheGreatMosqueOfCordoba.pde @@ -7,7 +7,8 @@ class IGPTheGreatMosqueOfCordoba extends IGPSquare{ PVector[][] horizontalVs; ArrayList <PVector> middleStar; IGPTheGreatMosqueOfCordoba(float x, float y, float d){ - super(x, y, d, 12); + super(x, y, d, 4); + setVectorsOnOuterSquare(); setInterlacingVs(); setSidePieces(); setCornerPieces(); @@ -15,192 +16,212 @@ class IGPTheGreatMosqueOfCordoba extends IGPSquare{ setMiddleStar(); } + void setVectorsOnOuterSquare(){ + vectorsOnOuterSquare = new ArrayList <PVector>(16); + vectorsOnOuterSquare.add(alphaCircleVectorsSixteen.get(0)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), mid.x+radius, false)); + vectorsOnOuterSquare.add(new PVector(mid.x+radius, mid.y+radius)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), mid.y+radius, true)); + vectorsOnOuterSquare.add(alphaCircleVectorsSixteen.get(4)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6), mid.y+radius, true)); + vectorsOnOuterSquare.add(new PVector(mid.x-radius, mid.y+radius)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(6), mid.x-radius, false)); + vectorsOnOuterSquare.add(alphaCircleVectorsSixteen.get(8)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(10), mid.x-radius, false)); + vectorsOnOuterSquare.add(new PVector(mid.x-radius, mid.y-radius)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(10), mid.y-radius, true)); + vectorsOnOuterSquare.add(alphaCircleVectorsSixteen.get(12)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(14), mid.y-radius, true)); + vectorsOnOuterSquare.add(new PVector(mid.x+radius, mid.y-radius)); + vectorsOnOuterSquare.add(getVectorOnExtendedLine(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), mid.x+radius, false)); + } + void setInterlacingVs(){ PVector[] vectors = new PVector[2]; verticalVs = new PVector[4][2]; horizontalVs = new PVector[4][2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(315), mid.y-radius, true); - vectors[1] = getVectorOnAlphaCircle(90); + vectors[0] = vectorsOnOuterSquare.get(13); + vectors[1] = vectorsOnOuterSquare.get(4); verticalVs[0] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(225), mid.y-radius, true); - vectors[1] = getVectorOnAlphaCircle(90); + vectors[0] = vectorsOnOuterSquare.get(11); + vectors[1] = vectorsOnOuterSquare.get(4); verticalVs[1] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), mid.y+radius, true); - vectors[1] = getVectorOnAlphaCircle(270); + vectors[0] = vectorsOnOuterSquare.get(3); + vectors[1] = vectorsOnOuterSquare.get(12); verticalVs[2] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135), mid.y+radius, true); - vectors[1] = getVectorOnAlphaCircle(270); + vectors[0] = vectorsOnOuterSquare.get(5); + vectors[1] = vectorsOnOuterSquare.get(12); verticalVs[3] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), mid.x+radius, false); - vectors[1] = getVectorOnAlphaCircle(180); + vectors[0] = vectorsOnOuterSquare.get(15); + vectors[1] = vectorsOnOuterSquare.get(8); horizontalVs[0] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), mid.x+radius, false); - vectors[1] = getVectorOnAlphaCircle(180); + vectors[0] = vectorsOnOuterSquare.get(1); + vectors[1] = vectorsOnOuterSquare.get(8); horizontalVs[1] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(225), mid.x-radius, false); - vectors[1] = getVectorOnAlphaCircle(0); + vectors[0] = vectorsOnOuterSquare.get(9); + vectors[1] = vectorsOnOuterSquare.get(0); horizontalVs[2] = vectors; vectors = new PVector[2]; - vectors[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(135), mid.x-radius, false); - vectors[1] = getVectorOnAlphaCircle(0); + vectors[0] = vectorsOnOuterSquare.get(7); + vectors[1] = vectorsOnOuterSquare.get(0); horizontalVs[3] = vectors; } void setMiddleStar(){ middleStar = new ArrayList <PVector>(16); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45))); - middleStar.add(getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2))); + middleStar.add(getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4))); } void setCornerPieces(){ cornerPieces = new PVector[4][4]; PVector[] cornerPiece = new PVector[4]; - cornerPiece[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), mid.x+radius, false); - cornerPiece[1] = new PVector(mid.x+radius, mid.y+radius); - cornerPiece[2] = getVectorOnExtendedLine(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), mid.y+radius, true); - cornerPiece[3] = getVectorOnAlphaCircle(45); + cornerPiece[0] = vectorsOnOuterSquare.get(1); + cornerPiece[1] = vectorsOnOuterSquare.get(2); + cornerPiece[2] = vectorsOnOuterSquare.get(3); + cornerPiece[3] = alphaCircleVectorsSixteen.get(2); cornerPieces[0] = cornerPiece; cornerPiece = new PVector[4]; - cornerPiece[0] = getVectorOnAlphaCircle(135); - cornerPiece[1] = getVectorOnExtendedLine(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135), mid.y+radius, true); - cornerPiece[2] = new PVector(mid.x-radius, mid.y+radius); - cornerPiece[3] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(135), mid.x-radius, false); + cornerPiece[0] = vectorsOnOuterSquare.get(5); + cornerPiece[1] = vectorsOnOuterSquare.get(6); + cornerPiece[2] = vectorsOnOuterSquare.get(7); + cornerPiece[3] = alphaCircleVectorsSixteen.get(6); cornerPieces[1] = cornerPiece; cornerPiece = new PVector[4]; - cornerPiece[0] = getVectorOnAlphaCircle(225); - cornerPiece[1] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(225), mid.y-radius, true); - cornerPiece[2] = new PVector(mid.x-radius, mid.y-radius); - cornerPiece[3] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(225), mid.x-radius, false); + cornerPiece[0] = alphaCircleVectorsSixteen.get(10); + cornerPiece[1] = vectorsOnOuterSquare.get(9); + cornerPiece[2] = vectorsOnOuterSquare.get(10); + cornerPiece[3] = vectorsOnOuterSquare.get(11); cornerPieces[2] = cornerPiece; cornerPiece = new PVector[4]; - cornerPiece[0] = new PVector(mid.x+radius, mid.y-radius); - cornerPiece[1] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), mid.x+radius, false); - cornerPiece[2] = getVectorOnAlphaCircle(315); - cornerPiece[3] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(315), mid.y-radius, true); + cornerPiece[0] = vectorsOnOuterSquare.get(14); + cornerPiece[1] = vectorsOnOuterSquare.get(15); + cornerPiece[2] = alphaCircleVectorsSixteen.get(14); + cornerPiece[3] = vectorsOnOuterSquare.get(13); cornerPieces[3] = cornerPiece; } void setSidePieces(){ sidePieces = new PVector[8][4]; PVector[] sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), mid.x+radius, false); - sidePiece[1] = getVectorOnAlphaCircle(0); - sidePiece[2] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); - sidePiece[3] = getVectorOnAlphaCircle(315); + sidePiece[0] = vectorsOnOuterSquare.get(0); + sidePiece[1] = vectorsOnOuterSquare.get(1); + sidePiece[2] = alphaCircleVectorsSixteen.get(2); + sidePiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0)); sidePieces[0] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnAlphaCircle(0); - sidePiece[1] = getVectorOnExtendedLine(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), mid.x+radius, false); - sidePiece[2] = getVectorOnAlphaCircle(45); - sidePiece[3] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0)); + sidePiece[0] = vectorsOnOuterSquare.get(3); + sidePiece[1] = vectorsOnOuterSquare.get(4); + sidePiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0)); + sidePiece[3] = alphaCircleVectorsSixteen.get(2); sidePieces[1] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), mid.y+radius, true); - sidePiece[1] = getVectorOnAlphaCircle(90); - sidePiece[2] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0)); - sidePiece[3] = getVectorOnAlphaCircle(45); + sidePiece[0] = vectorsOnOuterSquare.get(4); + sidePiece[1] = vectorsOnOuterSquare.get(5); + sidePiece[2] = alphaCircleVectorsSixteen.get(6); + sidePiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); sidePieces[2] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnAlphaCircle(90); - sidePiece[1] = getVectorOnExtendedLine(getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(135), mid.y+radius, true); - sidePiece[2] = getVectorOnAlphaCircle(135); - sidePiece[3] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); + sidePiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + sidePiece[1] = alphaCircleVectorsSixteen.get(6); + sidePiece[2] = vectorsOnOuterSquare.get(7); + sidePiece[3] = vectorsOnOuterSquare.get(8); sidePieces[3] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - sidePiece[1] = getVectorOnAlphaCircle(135); - sidePiece[2] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(135), mid.x-radius, false); - sidePiece[3] = getVectorOnAlphaCircle(180); + sidePiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4)); + sidePiece[1] = vectorsOnOuterSquare.get(8); + sidePiece[2] = vectorsOnOuterSquare.get(9); + sidePiece[3] = alphaCircleVectorsSixteen.get(10); sidePieces[4] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90)); - sidePiece[1] = getVectorOnAlphaCircle(180); - sidePiece[2] = getVectorOnExtendedLine(getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(225), mid.x-radius, false); - sidePiece[3] = getVectorOnAlphaCircle(225); + sidePiece[0] = vectorsOnOuterSquare.get(12); + sidePiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + sidePiece[2] = alphaCircleVectorsSixteen.get(10); + sidePiece[3] = vectorsOnOuterSquare.get(11); sidePieces[5] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnAlphaCircle(270); - sidePiece[1] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - sidePiece[2] = getVectorOnAlphaCircle(225); - sidePiece[3] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(225), mid.y-radius, true); + sidePiece[0] = vectorsOnOuterSquare.get(13); + sidePiece[1] = alphaCircleVectorsSixteen.get(14); + sidePiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2)); + sidePiece[3] = vectorsOnOuterSquare.get(12); sidePieces[6] = sidePiece; sidePiece = new PVector[4]; - sidePiece[0] = getVectorOnExtendedLine(getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(315), mid.y-radius, true); - sidePiece[1] = getVectorOnAlphaCircle(315); - sidePiece[2] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45)); - sidePiece[3] = getVectorOnAlphaCircle(270); + sidePiece[0] = vectorsOnOuterSquare.get(15); + sidePiece[1] = vectorsOnOuterSquare.get(0); + sidePiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); + sidePiece[3] = alphaCircleVectorsSixteen.get(14); sidePieces[7] = sidePiece; } void setStarPieces(){ starPieces = new PVector[8][4]; PVector[] starPiece = new PVector[4]; - starPiece[0] = getVectorOnAlphaCircle(315); - starPiece[1] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45)); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315)); + starPiece[0] = alphaCircleVectorsSixteen.get(14); + starPiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2)); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14)); starPieces[0] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getVectorOnAlphaCircle(0); - starPiece[1] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); + starPiece[0] = alphaCircleVectorsSixteen.get(0); + starPiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); starPieces[1] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); - starPiece[1] = getVectorOnAlphaCircle(45); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); + starPiece[1] = alphaCircleVectorsSixteen.get(2); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); starPieces[2] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(90)); - starPiece[1] = getVectorOnAlphaCircle(90); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(4)); + starPiece[1] = alphaCircleVectorsSixteen.get(4); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); starPieces[3] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(0)); - starPiece[1] = getVectorOnAlphaCircle(135); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45)); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(0)); + starPiece[1] = alphaCircleVectorsSixteen.get(6); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2)); starPieces[4] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[1] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[2] = getVectorOnAlphaCircle(180); - starPiece[3] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90)); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[2] = alphaCircleVectorsSixteen.get(8); + starPiece[3] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4)); starPieces[5] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[1] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(90)); - starPiece[3] = getVectorOnAlphaCircle(225); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(4)); + starPiece[3] = alphaCircleVectorsSixteen.get(10); starPieces[6] = starPiece; starPiece = new PVector[4]; - starPiece[0] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(45)); - starPiece[1] = getLineIntersection(getVectorOnAlphaCircle(180), getVectorOnAlphaCircle(315), getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0)); - starPiece[2] = getLineIntersection(getVectorOnAlphaCircle(225), getVectorOnAlphaCircle(0), getVectorOnAlphaCircle(270), getVectorOnAlphaCircle(135)); - starPiece[3] = getVectorOnAlphaCircle(270); + starPiece[0] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(2)); + starPiece[1] = getLineIntersection(alphaCircleVectorsSixteen.get(8), alphaCircleVectorsSixteen.get(14), alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0)); + starPiece[2] = getLineIntersection(alphaCircleVectorsSixteen.get(10), alphaCircleVectorsSixteen.get(0), alphaCircleVectorsSixteen.get(12), alphaCircleVectorsSixteen.get(6)); + starPiece[3] = alphaCircleVectorsSixteen.get(12); starPieces[7] = starPiece; } @@ -268,23 +289,28 @@ class IGPTheGreatMosqueOfCordoba extends IGPSquare{ } void display(){ - setStrokeColor(new Float[] {0.66, 0.66, 0.8, 1.0}); + setStrokeColor(new Float[] {0.0, 0.0, 0.0, 0.0}); setFillColor(new Float[] {0.0, 1.0, 0.0, 1.0}); createSidePieces(); - setStrokeColor(new Float[] {0.66, 0.0, 0.0, 1.0}); + setStrokeColor(new Float[] {0.0, 0.0, 0.0, 0.0}); setFillColor(new Float[] {1.0, 1.0, 1.0, 1.0}); createCornerPieces(); - setStrokeColor(new Float[] {0.66, 0.0, 0.0, 1.0}); + setStrokeColor(new Float[] {0.0, 0.0, 0.0, 0.0}); setFillColor(new Float[] {1.0, 0.0, 0.0, 1.0}); createStarPieces(); - setStrokeColor(new Float[] {0.66, 0.66, 0.8, 1.0}); + setStrokeColor(new Float[] {0.0, 0.0, 0.0, 0.0}); setFillColor(new Float[] {0.0, 0.0, 1.0, 1.0}); createMiddleStar(); } void displayConstructionLines(){ super.displayConstructionLines(); - setStrokeColor(new Float[] {0.66, 0.0, 0.8, 1.0}); + setStrokeColor(new Float[] {0.4, 0.4, 0.8, 1.0}); createInterlacingVs(); + setStrokeColor(new Float[] {0.8, 0.0, 0.0, 1.0}); + setFillColor(new Float[] {0.8, 0.8, 0.8, 1.0}); + createVectorIndicatorOnOuterSquare(4); + setStrokeColor(new Float[] {0.4, 0.4, 0.8, 1.0}); + setFillColor(new Float[] {0.0, 0.0, 0.0, 0.0}); } } |