geogebra_exec
Execute GeoGebra commands to build dynamic geometry constructions, animated mechanisms, and interactive diagrams using points, lines, circles, and sliders.
Instructions
Execute a GeoGebra command. To make a mechanism MOVE (animate), you MUST create an angle slider and define points that depend on it.
── COMMAND REFERENCE ──
POINTS: A = (x, y) — free point A = (3, 4) M = Midpoint(A, B) — midpoint P = Point(c, 0.5) — point on curve c at parameter 0..1
ANGLE SLIDER (the KEY to animation): α = 30° — creates an angle slider. ALWAYS start with this β = 60° — for mechanisms needing a second angle These become sliders. Use StartAnimation(α) to drive motion.
DEPENDENT POINTS (formulas using the angle): A = O1 + (rcos(α), rsin(α)) A = (rcos(α), rsin(α)) — same when O1 is origin X = (acos(α), bsin(α)) — ellipse motion These points MOVE when α changes. This is how animation works.
LINES & SEGMENTS: Line(A, B) — infinite line through A,B Segment(A, B) — segment between A,B Ray(A, B) — ray from A through B PerpendicularLine(A, l)— line through A ⟂ l ParallelLine(A, l) — line through A ∥ l
CIRCLES & ARCS: Circle(O, r) — circle center O radius r Circle(O, A) — circle center O through point A c = Circle(O1, 2) — name it 'c' to reuse
INTERSECTIONS (critical for mechanisms): P = Intersect(c1, c2) — all intersections P = Intersect(c1, c2, 1) — FIRST intersection (use 1 or 2) P = Intersect(c1, c2, 2) — SECOND intersection P = Intersect(Segment(A,B), c) — segment-circle intersection
ANGLES: Angle(A, O, B) — ∠AOB in degrees
SLIDER (numeric): r = 2 — creates a numeric slider if value is a plain number r = Slider(0, 5, 0.1) — explicit slider(min, max, step)
TRANSFORMATIONS: Rotate(A, α, O) — rotate A around O by angle α Dilate(A, s, O) — dilate A from O by factor s Translate(A, v) — translate A by vector v
ANIMATION: StartAnimation(α) — start the slider α animating StartAnimation() — start all sliders StopAnimation() — stop all animations SetAnimationSpeed(α, s) — set speed (0.1–10) After building the mechanism, always call StartAnimation(angle_label) and then geogebra_animate() for speed control.
MISC: ZoomIn(1) — zoom ZoomOut(1) — un-zoom Pan(x, y) — pan view
── CRITICAL RULES ──
ALWAYS create an angle slider (eg α=30°) FIRST before dependent points
Dependent points use cos(α), sin(α) — they move when α animates
For linkages, define fixed pivots → slider → dependent points → segments
Intersect() with index 1 or 2 picks WHICH intersection to use
After all commands, call geogebra_animate() to start motion
Args: command: GeoGebra command string (see reference above)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |