Free articulated cube

This activity belongs to the GeoGebra book Linkages. In this construction you can manipulate the articulated cube with no more restriction than that imposed by the relative distances of its 8 vertices, that is, by the 1 unit length of its 12 bars. The colors of the vertices and the triangles simply serve to favor the visualization of the state of the cube at each moment, since all the vertices behave in the same way. At any time you can change the position of any vertex (for example, B) by its isomer (B'), using the corresponding box in the left panel. The construction uses two levels of scripts. The first script is executed when moving a vertex. Suppose, for example, that we move point A. When we do so, the script guionA will be executed, which assigns the positions of the vertices to the points V1, ..., V8, following an order:
  • Point V1 takes the position of A.
  • Points V2, V3 and V4 take the position of the vertices next to A: O, B and D.
  • Points V5, V6 and V7 take the position of the vertices contiguous to the previous ones: U, E, J.
  • Finally, point V8 takes the position of F.
Then the script guionA (or guionB, guionD... depending on the vertex being moved) calls the script guion to execute. This script uses the values of V1, ..., V8 to recalculate the new positions. Once recalculated, guionA reassigns such positions to the corresponding vertices: A takes the recalculated value of V1, O takes that of V2, etc. In this way, the script guion is common to any vertex that moves. To calculate the new positions of the vertices V1, ..., V8, the motion transmission method already described in previous activities is used: the new position of V1 is transmitted to V2, V3 and V4, which in turn transmit their new values to V5, V6 and V7. This second transmission is done by guaranteeing that the circumradius of the triangle that has these points as vertices is not greater than unity, so that a position for V8 is possible. Finally, this position V8 is determined. Special cases in which the coordinates of two or more vertices coincide are also taken into account in the transmission process. After the construction you can see the guionA (other vertices have an analogous script) and the details of the script guion.
Author of the construction of GeoGebra: Rafael Losada