Geometric pattern
I saw a nice pattern in Matt's t-shirt and I thought I can make it in GeoGebra:[br][br]https://www.youtube.com/watch?v=ga9Qk38FaHM&ab_channel=Stand-upMaths[br][br]The code is a little messy but works. I will refactor in the future. :)[br][br]If you like my work, you can support me in Patreon: [br]https://www.patreon.com/jcponce[br][br]Get my recent Mathematical Art with GeoGebra ebook:[br]https://www.patreon.com/jcponce/shop/mathematical-art-with-geogebra-577631[br][br]∞ Thanks fro your support!
[code]A1 = (0, 0)[br]A2 = (x(A1) + 0.87, y(A1) + 0.5)[br]A3 = (x(A1) + 0.87, y(A1) + 3)[br]A4 = (x(A1), y(A1) + 3.5)[br]A5 = (x(A1) -0.87, y(A1) + 3)[br]A6 = (x(A1) - 0.87, y(A1) + 0.5)[br][br]rightSide = Polygon({A1, A2, A3, A4, A1})[br]leftSide = Polygon({A1, A4, A5, A6, A1})[br][br]rightSide' = Polygon({A1, A2, A3, A4, A1})[br]leftSide' = Polygon({A1, A4, A5, A6, A1})[br][br]block01 = {rightSide, leftSide}[br]block02 = Rotate(block01, 2pi/3, A1)[br]block03 = Rotate(block01, -2pi/3, A1)[br]block02' = Rotate(block01, 2pi/3, A1)[br]block03' = Rotate(block01, -2pi/3, A1)[br][br]centerFigure = {rightSide, leftSide, block02, block03}[br][br]#d1 = Length(A1, A4) + Length(A1, A2)[br][br]B1 = (x(A1) + 3.9, y(A1) + 2.25)[br]B2 = (x(A1), y(A1) + 4.5)[br]B3 = (x(A1) - 3.9, y(A1) + 2.25)[br]B4 = (x(A1) - 3.9, y(A1) - 2.25)[br]B5 = (x(A1), y(A1) - 4.5)[br]B6 = (x(A1) + 3.9, y(A1) - 2.25)[br][br]Execute(Zip("u"+k+" = Vector(A1, B"+k+")", k, 1...6))[br][br]#layer01 = Translate(centerFigure, u1)[br][br]Execute(Zip("layer0"+k+" = Translate(centerFigure, u"+k+")", k, 1...6))[br]Execute(Zip("layer0"+k+"' = Translate(centerFigure, u"+k+")", k, 1...6))[br][br]small01 = Rotate(Translate(block01, u2), -pi/3, B2)[br]small02 = Rotate(Translate(block01, u2), pi/3, B2)[br]small03 = Rotate(Translate(block01, u2), pi/3, A1)[br][br]small04 = Translate(Rotate(block01, pi/3, A1), u4)[br]small05 = Translate(Rotate(block01, pi, A1), u4)[br]small06 = Translate(Rotate(block01, pi, A1), u5)[br][br]small07 = Translate(Rotate(block01, pi, A1), u6)[br]small08 = Translate(Rotate(block01, -pi/3, A1), u6)[br]small09 = Translate(Rotate(block01, -pi/3, A1), u1)[br][br]small01' = Rotate(Translate(block01, u2), -pi/3, B2)[br]small02' = Rotate(Translate(block01, u2), pi/3, B2)[br]small03' = Rotate(Translate(block01, u2), pi/3, A1)[br][br]small04' = Translate(Rotate(block01, pi/3, A1), u4)[br]small05' = Translate(Rotate(block01, pi, A1), u4)[br]small06' = Translate(Rotate(block01, pi, A1), u5)[br][br]small07' = Translate(Rotate(block01, pi, A1), u6)[br]small08' = Translate(Rotate(block01, -pi/3, A1), u6)[br]small09' = Translate(Rotate(block01, -pi/3, A1), u1)[br][/code]
[code][/code][code]A1 = (0, 0)[br]A2 = (x(A1) + 0.87, y(A1) + 0.5)[br]A3 = (x(A1) + 0.87, y(A1) + 3)[br]A4 = (x(A1), y(A1) + 3.5)[br]A5 = (x(A1) -0.87, y(A1) + 3)[br]A6 = (x(A1) - 0.87, y(A1) + 0.5)[br]Ln = 1...6[br]Execute(Zip("SetVisibleInView(A"+k+", 1, false)", k, Ln))[br][br]rightSide = Polygon({A1, A2, A3, A4, A1})[br]leftSide = Polygon({A1, A4, A5, A6, A1})[br]SetLayer(rightSide, 4)[br]SetLayer(leftSide, 4)[br][br]rightSide' = Polygon({A1, A2, A3, A4, A1})[br]leftSide' = Polygon({A1, A4, A5, A6, A1})[br]SetLayer(rightSide', 5)[br]SetLayer(leftSide', 5)[br][br]block01 = {rightSide, leftSide}[br][br]block02 = Rotate(block01, 2pi/3, A1)[br]block03 = Rotate(block01, -2pi/3, A1)[br]SetLayer(block02, 4)[br]SetLayer(block03, 4)[br][br]block02' = Rotate(block01, 2pi/3, A1)[br]block03' = Rotate(block01, -2pi/3, A1)[br]SetLayer(block02', 5)[br]SetLayer(block03', 5)[br][br]centerFigure = {rightSide, leftSide, block02, block03}[br][br]B1 = (x(A1) + 3.9, y(A1) + 2.25)[br]B2 = (x(A1), y(A1) + 4.5)[br]B3 = (x(A1) - 3.9, y(A1) + 2.25)[br]B4 = (x(A1) - 3.9, y(A1) - 2.25)[br]B5 = (x(A1), y(A1) - 4.5)[br]B6 = (x(A1) + 3.9, y(A1) - 2.25)[br]Execute(Zip("SetVisibleInView(B"+k+", 1, false)", k, Ln))[br][br]Execute(Zip("u"+k+" = Vector(A1, B"+k+")", k, Ln))[br]Execute(Zip("SetVisibleInView(u"+k+", 1, false)", k, Ln))[br][br]Execute(Zip("first0"+k+" = Translate(centerFigure, u"+k+")", k, Ln))[br]Execute(Zip("first0"+k+"' = Translate(centerFigure, u"+k+")", k, Ln))[br][br]Execute(Zip("SetLayer(first0"+k+", 2)", k, Ln))[br]Execute(Zip("SetLayer(first0"+k+"', 3)", k, Ln))[br][br]Execute(Zip("second0"+k+" = Rotate(Translate(centerFigure, u"+k+"), pi/3, B"+k+")", k, Ln))[br]Execute(Zip("second0"+k+"' = Rotate(Translate(centerFigure, u"+k+"), pi/3, B"+k+")", k, Ln))[br][br]Execute(Zip("SetLayer(second0"+k+", 0)", k, Ln))[br]Execute(Zip("SetLayer(second0"+k+"', 1)", k, Ln))[/code]
[code]A1 = (0, 0)[br]A2 = (x(A1) + 0.87, y(A1) + 0.5)[br]A3 = (x(A1) + 0.87, y(A1) + 3)[br]A4 = (x(A1), y(A1) + 3.5)[br]A5 = (x(A1) -0.87, y(A1) + 3)[br]A6 = (x(A1) - 0.87, y(A1) + 0.5)[br]Ln = 1...6[br]Execute(Zip("SetVisibleInView(A"+k+", 1, false)", k, Ln))[br][br]rightSide = Polygon({A1, A2, A3, A4, A1})[br]leftSide = Polygon({A1, A4, A5, A6, A1})[br][br]rightSide' = Polygon({A1, A2, A3, A4, A1})[br]leftSide' = Polygon({A1, A4, A5, A6, A1})[br][br]block01 = {rightSide, leftSide}[br]block02 = Rotate(block01, 2pi/3, A1)[br]block03 = Rotate(block01, -2pi/3, A1)[br][br]block02' = Rotate(block01, 2pi/3, A1)[br]block03' = Rotate(block01, -2pi/3, A1)[br][br]centerFigure = {rightSide, leftSide, block02, block03}[br][br]B1 = (x(A1) + 3.9, y(A1) + 2.25)[br]B2 = (x(A1), y(A1) + 4.5)[br]B3 = (x(A1) - 3.9, y(A1) + 2.25)[br]B4 = (x(A1) - 3.9, y(A1) - 2.25)[br]B5 = (x(A1), y(A1) - 4.5)[br]B6 = (x(A1) + 3.9, y(A1) - 2.25)[br]Execute(Zip("SetVisibleInView(B"+k+", 1, false)", k, Ln))[br][br]Execute(Zip("u"+k+" = Vector(A1, B"+k+")", k, Ln))[br]Execute(Zip("SetVisibleInView(u"+k+", 1, false)", k, Ln))[br][br]Execute(Zip("first0"+k+" = Translate(centerFigure, u"+k+")", k, Ln))[br]Execute(Zip("first0"+k+"' = Translate(centerFigure, u"+k+")", k, Ln))[br][br]Execute(Zip("second0"+k+" = Rotate(Translate(centerFigure, u"+k+"), pi/3, B"+k+")", k, Ln))[br]Execute(Zip("second0"+k+"' = Rotate(Translate(centerFigure, u"+k+"), pi/3, B"+k+")", k, Ln))[br][br]C1 = (x(A1), y(A1) + 2.5)[br]C2 = (x(A1) + 0.87, y(A1) + 3)[br]C3 = (x(A1), y(A1) + 3.5)[br]C4 = (x(A1) - 0.87, y(A1) + 3)[br]Execute(Zip("SetVisibleInView(C"+k+", 1, false)", k, 1...4))[br][br]rom01 = Polygon({C1, C2, C3, C4})[br]rom02 = Rotate(rom01, 2pi/3)[br]rom03 = Rotate(rom01, -2pi/3)[br][br]Lk = {5, 6, 1}[br]Execute(Zip("p0"+k+" = Translate(rom01, u"+k+")", k, 1...3))[br]Execute(Zip("q0"+k+" = Translate(rom02, u"+k+")", k, 3...5))[br]Execute(Zip("r0"+k+" = Translate(rom03, u"+k+")", k, Lk))[br][br]Execute(Zip("p0"+k+"' = Translate(rom01, u"+k+")", k, 1...3))[br]Execute(Zip("q0"+k+"' = Translate(rom02, u"+k+")", k, 3...5))[br]Execute(Zip("r0"+k+"' = Translate(rom03, u"+k+")", k, Lk))[br][br]#-- Set Layers --#[br]Execute(Zip("SetLayer(second0"+k+", 0)", k, Ln))[br]Execute(Zip("SetLayer(second0"+k+"', 1)", k, Ln))[br][br]Execute(Zip("SetLayer(first0"+k+", 2)", k, Ln))[br]Execute(Zip("SetLayer(first0"+k+"', 3)", k, Ln))[br][br]Execute(Zip("SetLayer(p0"+k+", 4)", k, 1...3))[br]Execute(Zip("SetLayer(q0"+k+", 4)", k, 3...5))[br]Execute(Zip("SetLayer(r0"+k+", 4)", k, Lk))[br][br]Execute(Zip("SetLayer(p0"+k+"', 5)", k, 1...3))[br]Execute(Zip("SetLayer(q0"+k+"', 5)", k, 3...5))[br]Execute(Zip("SetLayer(r0"+k+"', 5)", k, Lk))[br][br]SetLayer(rightSide, 6)[br]SetLayer(leftSide, 6)[br]SetLayer(rightSide', 7)[br]SetLayer(leftSide', 7)[br][br]SetLayer(block02, 6)[br]SetLayer(block03, 6)[br]SetLayer(block02', 7)[br]SetLayer(block03', 7)[br][/code]