Google ClassroomGoogle Classroom
GeoGebraGeoGebra Classroom

polygon can be moved and rotated

Ein Polygon über einen Anfasser (move point) verschieben und über einen Eckpunkt drehen (rotation point). Die hauseigene Funktion "RigidPolygon" erzeugt alle Eckpunkte und Kanten als neue Elemente und legt die Aktionspunkte auf die ersten beiden Eckpunkte. Ein neuer Ansatz verwendet 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) Puzzel 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. Move a polygon using a handle and rotate it using a vertex. The built-in “RigidPolygon” function generates all vertices and edges as new elements and then sets the action points to the first two vertices. A new approach uses 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) Puzzle Reconstruct C to the shape of A, add a figure D like A and combine these 4 Polygons to a square.
RigidPolygonGridScript.ggb To start, I create the rotation center "A" (move point) and add "A" and the vertices of a polygon to a list called Grid A = (0,0) Grid = {(0, 0), (-2, 0), (-2, 2), (1, 2), (3, 0), (1, -2)} The pivot point "a" moves along a circle centered at move point "A" a=Point(Circle(A, abs(Grid(2) - Grid(1)))) Using move point "A" and pivot point "a", I construct the other vertices A + Unit Vector(a-A) A + |Grid(1)-Grid(3)| UnitVector(a - A) Rotate this Point to the right position in the Polygon Rotate(A + |Grid(1)-Grid(3)| UnitVector(a - A),Angle(Grid(2),Grid(1),Grid(3)),A) We loop from Grid(3) to the end of the Grid list j=3...5 Sequence(Rotate(A + |Grid(1)-Grid(j)| UnitVector(a - A),Angle(Grid(2),Grid(1),Grid(j)),A),j,3,Length(Grid)) Our list starts with the 3rd grid element, so we'll place the 2nd element at the beginning of the list 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))}) FigA is dependent on the Grid list - means changes of Grid will have an effect to FigA! make a script to get rid of the list "Grid" We are separating the grid elements from the text in order to insert the coordinate values of the points.
Sequence(",Rotate(A +" + (abs(Grid(1) - Grid(j))) + "*UnitVector(a - A), Angle(" + (Grid(2)) + "," + (Grid(1)) + "," + (Grid(j)) + "), A)", j, 3, Length(Grid))
Combine the individual text elements of the list into a single text block and make an embedded list within the text
FitA = Sequence(", Rotate(A +"+abs(Grid(1) - Grid(j))+"*UnitVector(a - A), Angle("+Grid(2) + ","+Grid(1) + ","+Grid(j) + "), A)", j, 3,Length(Grid))
FitA="{a"+Sum(Sequence(",Rotate(A +" + (abs(Grid(1) - Grid(j))) + "*UnitVector(a - A), Angle(" + (Grid(2)) + "," + (Grid(1)) + "," + (Grid(j)) + "), A)", j, 3, Length(Grid)))+"}" Execute({"a=Point(Circle(A,"+abs(Grid(2) - Grid(1))+"))"}) Execute({"FigA="+FitA}) FigA={a, Rotate(A + 2.83UnitVector(a - A), Angle((-2, 0), (0, 0), (-2, 2)), A), Rotate(A + 2.24UnitVector(a - A), Angle((-2, 0), (0, 0), (1, 2)), A), Rotate(A + 3UnitVector(a - A), Angle((-2, 0), (0, 0), (3, 0)), A), Rotate(A + 2.24UnitVector(a - A), Angle((-2, 0), (0, 0), (1, -2)), A)} {(-2, 0), (-2, 2), (1, 2), (3, 0), (1, -2)}