Free string
This activity belongs to the GeoGebra book Linkages.
GeoGebra allows two types of scripts:
- Those specific to this Dynamic Geometry program, made up of successive commands lines. They are the ones we have used so far, simple and without the need to know programming.
- Those typical of programming in Javascript.
The Javascript code used is detailed below.
When moving A1:
var j = 2;
while (j <= 40) {
ggbApplet.evalCommand("SetValue(A" + j + ", Intersect(Ray(A" + (j-1) + ", A" + j + "), Circle(A" + (j-1) + " ,1)))");
j++;
}
When moving A40:
var j = 39;
while (j > 0) {
ggbApplet.evalCommand("SetValue(A" + j + ", Intersect(Ray(A" + (j+1) + ", A" + j + "), Circle(A" + (j+1) + " ,1)))");
j--;
}
Author of the construction of GeoGebra: Rafael Losada