Google ClassroomGoogle Classroom
GeoGebraGeoGebra Classroom

Animated Slider Scripts

This activity belongs to the GeoGebra book GeoGebra Principia. However, we cannot generalize this method to polygons with more than 4 sides, as adjusting the length of the fifth side can disrupt the already adjusted ones. We would need iterative, continuous readjustment, until achieving the desired result. Well, we can achieve this continuous readjustment by utilizing a script that is executed continuously, associated with the update of the value of an animated slider. For instance, in the first scene, it might seem that P is a point on the circle (with a radius of 4 centered at A), but in reality, it is a free point. By dragging it, it will return to the circle because the script of the animated slider is executed continuously. This script is:

SetValue(P, P + u)

where:

u = A - P + 4 UnitVector(P − A)

We can add a coefficient (k) to control the speed: SetValue(P, P + k u) If we add another vector, P will move towards the nearest intersection, even if there is no intersection! By doing the same with 5 points and 5 vectors, voilà! We can now maintain equidistance among more than four points.
Author of the construction of GeoGebra: Rafael Losada.