polygon can be moved and rotated

[table][tr][td]Ein Polygon über einen Anfasser (move point) verschieben und über einen Eckpunkt drehen (rotation point).[br][br]Die hauseigene Funktion "RigidPolygon" erzeugt alle Eckpunkte und Kanten als neue Elemente und legt die Aktionspunkte auf die ersten beiden Eckpunkte.[br][br]Ein neuer Ansatz verwendet [br]Grid={Anfasser (Großbuchstabe), Eckpunkte,...} und erzeugt damit Drehpunkt (Kleinbuchstabe) und eine Liste der Eckpunkte Fig(Großbuchstabe) beruhend auf Anfasser und Drehpunkt als Referenz sowie das Polygon poly(Großbuchstabe)[br][br]Puzzel[br]Gestalte C entsprechend der Form von A um, füge eine Figur D hinzu, die wie A aussieht und verbinde diese vier Polygone zu einem Quadrat.[br][/td][td]Move a polygon using a handle and rotate it using a vertex.[br][br]The built-in “RigidPolygon” function generates all vertices and edges as new elements and then sets the action points to the first two vertices.[br][br]A new approach uses[br]Grid={Handle (uppercase), Vertices,...} to generate a rotation point (lowercase) and a list of vertices Fig(uppercase) based on the handle and rotation point as references, as well as the polygon poly(uppercase)[br][br]Puzzle[br]Reconstruct C to the shape of A, add a figure D like A and combine these 4 Polygons to a square.[/td][/tr][/table][br][size=85]RigidPolygonGridScript.ggb[br][/size][br][color=#3c78d8]To start, I create the rotation center "A" (move point) and add "A" and the vertices of a polygon to a list called Grid[/color][br]A = (0,0)[br]Grid={(1.6635, 1.2086),(0, 0),(3.14159, 0),(2.5416, 1.84658),(0.970806, 2.98783)}[br][br][color=#3c78d8]The pivot point "a" moves along a circle centered at move point "A"[/color][br]a=Point(Circle(A, abs(Grid(2) - Grid(1))))[br][br][color=#3c78d8]Using move point "A" and pivot point "a", I construct the other vertices [/color][br] [color=#999999] A + Unit Vector(a-A)[br] A + |Grid(1)-Grid(3)| UnitVector(a - A)[/color][br][br][color=#3c78d8]Rotate this Point to the right position in the Polygon[/color][br] [color=#999999] Rotate(A + |Grid(1)-Grid(3)| UnitVector(a - A),Angle(Grid(2),Grid(1),Grid(3)),A)[/color][br][br][color=#3c78d8]We loop from Grid(3) to the end of the Grid list j=3...5 [/color][br][color=#999999] Sequence(Rotate(A + |Grid(1)-Grid(j)| UnitVector(a - A),Angle(Grid(2),Grid(1),Grid(j)),A),j,3,Length(Grid))[/color][br][br][color=#3c78d8]Our list starts with the 3rd grid element, so we'll place the 2nd element at the beginning of the list[/color][br]FigA=Join({{a}, Sequence(Rotate(A + abs(Grid(j) - Grid(1)) UnitVector(a - A), Angle(Grid(2), Grid(1), Grid(j)), A), j, 3, Length(Grid))})[br][br]FigA is dependent on the Grid list - means changes of Grid will have an effect to FigA![br][br][size=150]make a script to get rid of the list "Grid"[br][/size][br][color=#3c78d8]We are separating the grid elements from the text in order to insert the coordinate values of the points.[/color][br][table][tr][td][/td][td][color=#999999]Sequence([/color][color=#ff00ff]"[/color][color=#999999]Rotate(A +[/color][color=#ff00ff]"[/color][color=#999999] [/color][color=#666666]+ [i](abs(Grid(1) - Grid(j)))[/i] +[/color][color=#999999] [/color][color=#ff00ff]"[/color][color=#999999]*UnitVector(a - A), Angle([/color][color=#ff00ff]"[/color][color=#999999] [/color][color=#666666][br]+ [i](Grid(2)) + [/i][/color][color=#ff00ff][i]"[/i][/color][color=#666666][i],[/i][/color][color=#ff00ff][i]"[/i][/color][color=#666666][i] + (Grid(1)) + [/i][/color][color=#ff00ff][i]"[/i][/color][color=#666666][i],[/i][/color][color=#ff00ff][i]"[/i][/color][color=#666666][i] + (Grid(j))[/i] + [/color][color=#ff00ff]"[/color][color=#999999]), A)[/color][color=#ff00ff]"[/color][color=#999999], j, 3, Length(Grid))[/color][/td][/tr][/table][br][color=#3c78d8]Combine the individual text elements of the list into a single text block and make an embedded list within the text[/color][table][tr][td][/td][td][color=#999999]FitA = Sequence("[/color][color=#ff0000][b],[/b][/color][color=#999999] Rotate(A +"[/color][color=#666666][i]+abs(Grid(1) - Grid(j))+[/i][/color][color=#999999]"*UnitVector(a - A), [br]Angle("[/color][color=#666666][i]+Grid(2) + ","+Grid(1) + ","+Grid(j) +[/i][/color][color=#999999] "), A)", j, 3,Length(Grid))[/color][/td][/tr][/table]Script Vertices X[br]FitX="{x"+Sum(Sequence(",Rotate(X +" + (abs(Grid(1) - Grid(j))) + "*UnitVector(x - X), Angle(" + (Grid(2)) + "," + (Grid(1)) + "," + (Grid(j)) + "), X)", j, 3, Length(Grid)))+"}"[br][br]All in one move point inside vertices[br][b]A[/b]=(?,?)[br]Execute({"NFig="+UnicodeToLetter(34)+"[b]A[/b]"+UnicodeToLetter(34) ,UnicodeToLetter(LetterToUnicode(NFig)+32)+"=Point(Circle("+NFig+","+abs(Grid(2) - Grid(1))+"))", "Fit"+NFig+"="+ReplaceAll(ReplaceAll(FitX,"X",NFig),"x", UnicodeToLetter(LetterToUnicode(NFig)+32)),"Fig"+NFig+"=Polygon(Fit"+NFig+")"})[br][math]\Longrightarrow[/math][color=#999999][br]FigA={a, [br]Rotate(A + 2.83UnitVector(a - A), Angle((-2, 0), (0, 0), (-2, 2)), A), [br]Rotate(A + 2.24UnitVector(a - A), Angle((-2, 0), (0, 0), (1, 2)), A), [br]Rotate(A + 3UnitVector(a - A), Angle((-2, 0), (0, 0), (3, 0)), A), [br]Rotate(A + 2.24UnitVector(a - A), Angle((-2, 0), (0, 0), (1, -2)), A)}[br][/color]
Aperiodische Parkettierungen – Penrose-Parkette
Reddit Article/Video

Informació: polygon can be moved and rotated