@lydt/geogebra-studio 0.0.0-stage → 0.4.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/.agents/plugins/marketplace.json +21 -0
  2. package/.codex-plugin/plugin.json +21 -0
  3. package/.mcp.json +18 -0
  4. package/LICENSE +339 -0
  5. package/LICENSE-MIT +21 -0
  6. package/README.md +108 -2
  7. package/README.zh-CN.md +89 -0
  8. package/THIRD_PARTY_NOTICES.md +35 -0
  9. package/dist/cli.d.ts +27 -0
  10. package/dist/cli.d.ts.map +1 -0
  11. package/dist/cli.js +234 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/export/files.d.ts +4 -0
  14. package/dist/export/files.d.ts.map +1 -0
  15. package/dist/export/files.js +44 -0
  16. package/dist/export/files.js.map +1 -0
  17. package/dist/export/gikz.d.ts +11 -0
  18. package/dist/export/gikz.d.ts.map +1 -0
  19. package/dist/export/gikz.js +28 -0
  20. package/dist/export/gikz.js.map +1 -0
  21. package/dist/export/html.d.ts +14 -0
  22. package/dist/export/html.d.ts.map +1 -0
  23. package/dist/export/html.js +97 -0
  24. package/dist/export/html.js.map +1 -0
  25. package/dist/export/semantic.d.ts +43 -0
  26. package/dist/export/semantic.d.ts.map +1 -0
  27. package/dist/export/semantic.js +212 -0
  28. package/dist/export/semantic.js.map +1 -0
  29. package/dist/export/viewer-themes.d.ts +76 -0
  30. package/dist/export/viewer-themes.d.ts.map +1 -0
  31. package/dist/export/viewer-themes.js +169 -0
  32. package/dist/export/viewer-themes.js.map +1 -0
  33. package/dist/export/workspace.d.ts +4 -0
  34. package/dist/export/workspace.d.ts.map +1 -0
  35. package/dist/export/workspace.js +25 -0
  36. package/dist/export/workspace.js.map +1 -0
  37. package/dist/gikz-browser.js +770 -0
  38. package/dist/index.d.ts +5 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +84 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/server.d.ts +35 -0
  43. package/dist/server.d.ts.map +1 -0
  44. package/dist/server.js +187 -0
  45. package/dist/server.js.map +1 -0
  46. package/dist/studio/artifact.d.ts +37 -0
  47. package/dist/studio/artifact.d.ts.map +1 -0
  48. package/dist/studio/artifact.js +61 -0
  49. package/dist/studio/artifact.js.map +1 -0
  50. package/dist/studio/browser.d.ts +7 -0
  51. package/dist/studio/browser.d.ts.map +1 -0
  52. package/dist/studio/browser.js +67 -0
  53. package/dist/studio/browser.js.map +1 -0
  54. package/dist/studio/install.d.ts +4 -0
  55. package/dist/studio/install.d.ts.map +1 -0
  56. package/dist/studio/install.js +60 -0
  57. package/dist/studio/install.js.map +1 -0
  58. package/dist/tools/apps-api-tools.d.ts +4 -0
  59. package/dist/tools/apps-api-tools.d.ts.map +1 -0
  60. package/dist/tools/apps-api-tools.js +96 -0
  61. package/dist/tools/apps-api-tools.js.map +1 -0
  62. package/dist/tools/educational-templates.d.ts +33 -0
  63. package/dist/tools/educational-templates.d.ts.map +1 -0
  64. package/dist/tools/educational-templates.js +261 -0
  65. package/dist/tools/educational-templates.js.map +1 -0
  66. package/dist/tools/export-tools.d.ts +3 -0
  67. package/dist/tools/export-tools.d.ts.map +1 -0
  68. package/dist/tools/export-tools.js +118 -0
  69. package/dist/tools/export-tools.js.map +1 -0
  70. package/dist/tools/geogebra-tools.d.ts +15 -0
  71. package/dist/tools/geogebra-tools.d.ts.map +1 -0
  72. package/dist/tools/geogebra-tools.js +3442 -0
  73. package/dist/tools/geogebra-tools.js.map +1 -0
  74. package/dist/tools/index.d.ts +43 -0
  75. package/dist/tools/index.d.ts.map +1 -0
  76. package/dist/tools/index.js +183 -0
  77. package/dist/tools/index.js.map +1 -0
  78. package/dist/tools/performance-tools.d.ts +7 -0
  79. package/dist/tools/performance-tools.d.ts.map +1 -0
  80. package/dist/tools/performance-tools.js +312 -0
  81. package/dist/tools/performance-tools.js.map +1 -0
  82. package/dist/tools/templates/algebra-templates.d.ts +7 -0
  83. package/dist/tools/templates/algebra-templates.d.ts.map +1 -0
  84. package/dist/tools/templates/algebra-templates.js +568 -0
  85. package/dist/tools/templates/algebra-templates.js.map +1 -0
  86. package/dist/tools/templates/geometry-templates.d.ts +7 -0
  87. package/dist/tools/templates/geometry-templates.d.ts.map +1 -0
  88. package/dist/tools/templates/geometry-templates.js +492 -0
  89. package/dist/tools/templates/geometry-templates.js.map +1 -0
  90. package/dist/types/geogebra.d.ts +103 -0
  91. package/dist/types/geogebra.d.ts.map +1 -0
  92. package/dist/types/geogebra.js +34 -0
  93. package/dist/types/geogebra.js.map +1 -0
  94. package/dist/types/mcp.d.ts +125 -0
  95. package/dist/types/mcp.d.ts.map +1 -0
  96. package/dist/types/mcp.js +19 -0
  97. package/dist/types/mcp.js.map +1 -0
  98. package/dist/utils/app-info.d.ts +12 -0
  99. package/dist/utils/app-info.d.ts.map +1 -0
  100. package/dist/utils/app-info.js +30 -0
  101. package/dist/utils/app-info.js.map +1 -0
  102. package/dist/utils/errors.d.ts +37 -0
  103. package/dist/utils/errors.d.ts.map +1 -0
  104. package/dist/utils/errors.js +72 -0
  105. package/dist/utils/errors.js.map +1 -0
  106. package/dist/utils/gemini-compatibility.d.ts +39 -0
  107. package/dist/utils/gemini-compatibility.d.ts.map +1 -0
  108. package/dist/utils/gemini-compatibility.js +154 -0
  109. package/dist/utils/gemini-compatibility.js.map +1 -0
  110. package/dist/utils/geogebra-instance.d.ts +252 -0
  111. package/dist/utils/geogebra-instance.d.ts.map +1 -0
  112. package/dist/utils/geogebra-instance.js +1560 -0
  113. package/dist/utils/geogebra-instance.js.map +1 -0
  114. package/dist/utils/geogebra-mock.d.ts +172 -0
  115. package/dist/utils/geogebra-mock.d.ts.map +1 -0
  116. package/dist/utils/geogebra-mock.js +732 -0
  117. package/dist/utils/geogebra-mock.js.map +1 -0
  118. package/dist/utils/logger.d.ts +4 -0
  119. package/dist/utils/logger.d.ts.map +1 -0
  120. package/dist/utils/logger.js +46 -0
  121. package/dist/utils/logger.js.map +1 -0
  122. package/dist/utils/performance/index.d.ts +76 -0
  123. package/dist/utils/performance/index.d.ts.map +1 -0
  124. package/dist/utils/performance/index.js +163 -0
  125. package/dist/utils/performance/index.js.map +1 -0
  126. package/dist/utils/performance/instance-pool.d.ts +78 -0
  127. package/dist/utils/performance/instance-pool.d.ts.map +1 -0
  128. package/dist/utils/performance/instance-pool.js +268 -0
  129. package/dist/utils/performance/instance-pool.js.map +1 -0
  130. package/dist/utils/validation.d.ts +92 -0
  131. package/dist/utils/validation.d.ts.map +1 -0
  132. package/dist/utils/validation.js +557 -0
  133. package/dist/utils/validation.js.map +1 -0
  134. package/dist/widget.html +110 -0
  135. package/docs/APPS-API-BRIDGE.md +28 -0
  136. package/docs/MODERNIZATION.md +15 -0
  137. package/docs/TANGENT-REGRESSION.md +34 -0
  138. package/docs/VALIDATION.md +26 -0
  139. package/docs/VISUAL-STANDARD.md +26 -0
  140. package/docs/images/native-construction.png +0 -0
  141. package/examples/tangent-construction.json +26 -0
  142. package/gikz/LICENSE +339 -0
  143. package/gikz/PROVENANCE.md +8 -0
  144. package/gikz/browser.cjs +2 -0
  145. package/gikz/cli.cjs +195 -0
  146. package/gikz/core.cjs +806 -0
  147. package/mcp.json +20 -0
  148. package/package.json +107 -4
  149. package/plugin.json +35 -0
  150. package/runtime/package.json +4 -0
  151. package/scripts/build-plugin.cjs +15 -0
  152. package/scripts/build-widget.cjs +7 -0
  153. package/skills/geogebra-construct/SKILL.md +40 -0
  154. package/skills/geogebra-setup/SKILL.md +37 -0
  155. package/skills/geometry-export/SKILL.md +31 -0
  156. package/src/cli.ts +212 -0
  157. package/src/export/files.ts +26 -0
  158. package/src/export/gikz.ts +22 -0
  159. package/src/export/html.ts +108 -0
  160. package/src/export/semantic.ts +180 -0
  161. package/src/export/viewer-themes.ts +165 -0
  162. package/src/export/workspace.ts +15 -0
  163. package/src/index.ts +71 -0
  164. package/src/server.ts +168 -0
  165. package/src/studio/artifact.ts +50 -0
  166. package/src/studio/browser.ts +38 -0
  167. package/src/studio/install.ts +43 -0
  168. package/src/tools/apps-api-tools.ts +96 -0
  169. package/src/tools/educational-templates.ts +299 -0
  170. package/src/tools/export-tools.ts +110 -0
  171. package/src/tools/geogebra-tools.ts +3836 -0
  172. package/src/tools/index.ts +192 -0
  173. package/src/tools/performance-tools.ts +322 -0
  174. package/src/tools/templates/algebra-templates.ts +619 -0
  175. package/src/tools/templates/geometry-templates.ts +550 -0
  176. package/src/types/geogebra.ts +140 -0
  177. package/src/types/global.d.ts +31 -0
  178. package/src/types/mcp.ts +141 -0
  179. package/src/utils/app-info.ts +35 -0
  180. package/src/utils/errors.ts +97 -0
  181. package/src/utils/gemini-compatibility.ts +193 -0
  182. package/src/utils/geogebra-instance.ts +1712 -0
  183. package/src/utils/geogebra-mock.ts +867 -0
  184. package/src/utils/logger.ts +60 -0
  185. package/src/utils/performance/index.ts +211 -0
  186. package/src/utils/performance/instance-pool.ts +323 -0
  187. package/src/utils/validation.ts +647 -0
  188. package/tsconfig.json +35 -0
  189. package/widget/main.ts +12 -0
@@ -0,0 +1,619 @@
1
+ import { EducationalTemplate } from '../educational-templates';
2
+ import { toolRegistry } from '../index';
3
+
4
+ /**
5
+ * Algebra Educational Templates
6
+ * Pre-built algebraic scenarios for common educational use cases
7
+ */
8
+
9
+ export const algebraTemplates: EducationalTemplate[] = [
10
+ {
11
+ id: 'quadratic_explorer',
12
+ name: 'Quadratic Function Explorer',
13
+ category: 'algebra',
14
+ description: 'Interactive exploration of quadratic functions, including vertex form, factored form, and transformations',
15
+ gradeLevel: '9-12',
16
+ objectives: [
17
+ 'Understand different forms of quadratic functions',
18
+ 'Explore the effects of parameters on graph shape and position',
19
+ 'Connect algebraic and geometric representations'
20
+ ],
21
+ prerequisites: ['Linear functions', 'Basic graphing skills', 'Algebraic manipulation'],
22
+ estimatedTime: 20,
23
+ setup: async () => {
24
+ // Create parameter sliders for quadratic function y = ax² + bx + c
25
+ await toolRegistry.executeTool('geogebra_create_slider', {
26
+ name: 'a',
27
+ min: -3,
28
+ max: 3,
29
+ value: 1,
30
+ increment: 0.1,
31
+ x: -8,
32
+ y: 6,
33
+ width: 120,
34
+ caption: 'a coefficient'
35
+ });
36
+
37
+ await toolRegistry.executeTool('geogebra_create_slider', {
38
+ name: 'b',
39
+ min: -6,
40
+ max: 6,
41
+ value: 0,
42
+ increment: 0.5,
43
+ x: -8,
44
+ y: 5,
45
+ width: 120,
46
+ caption: 'b coefficient'
47
+ });
48
+
49
+ await toolRegistry.executeTool('geogebra_create_slider', {
50
+ name: 'c',
51
+ min: -5,
52
+ max: 5,
53
+ value: 0,
54
+ increment: 0.5,
55
+ x: -8,
56
+ y: 4,
57
+ width: 120,
58
+ caption: 'c coefficient'
59
+ });
60
+
61
+ // Create the quadratic function
62
+ await toolRegistry.executeTool('geogebra_plot_function', {
63
+ name: 'quadratic',
64
+ expression: 'a*x^2 + b*x + c',
65
+ color: '#FF0000',
66
+ thickness: 3,
67
+ style: 'solid'
68
+ });
69
+
70
+ // Calculate and show vertex
71
+ await toolRegistry.executeTool('geogebra_create_point', {
72
+ name: 'vertex',
73
+ x: -0.5, // Will be calculated as -b/(2a) in real implementation
74
+ y: 0, // Will be calculated as f(-b/(2a)) in real implementation
75
+ color: '#00AA00',
76
+ size: 6,
77
+ label: 'Vertex'
78
+ });
79
+
80
+ // Show axis of symmetry
81
+ await toolRegistry.executeTool('geogebra_create_line', {
82
+ name: 'axisOfSymmetry',
83
+ type: 'vertical',
84
+ value: -0.5, // x = -b/(2a)
85
+ color: '#00AA00',
86
+ thickness: 1,
87
+ style: 'dashed'
88
+ });
89
+
90
+ // Create x-intercepts (if they exist)
91
+ await toolRegistry.executeTool('geogebra_create_point', {
92
+ name: 'yIntercept',
93
+ x: 0,
94
+ y: 0, // Will be c in real implementation
95
+ color: '#0000FF',
96
+ size: 4,
97
+ label: 'y-intercept'
98
+ });
99
+
100
+ // Add function equation display
101
+ await toolRegistry.executeTool('geogebra_create_text', {
102
+ text: '"f(x) = " + a + "x² + " + b + "x + " + c',
103
+ x: -8,
104
+ y: 2,
105
+ fontSize: 16,
106
+ color: '#FF0000',
107
+ fontStyle: 'bold'
108
+ });
109
+
110
+ // Add vertex form display
111
+ await toolRegistry.executeTool('geogebra_create_text', {
112
+ text: '"Vertex Form: f(x) = " + a + "(x - " + (-b/(2*a)) + ")² + " + (c - b²/(4*a))',
113
+ x: -8,
114
+ y: 1,
115
+ fontSize: 14,
116
+ color: '#00AA00'
117
+ });
118
+
119
+ // Add discriminant information
120
+ await toolRegistry.executeTool('geogebra_create_text', {
121
+ text: '"Discriminant: Δ = " + (b² - 4*a*c)',
122
+ x: -8,
123
+ y: 0,
124
+ fontSize: 14,
125
+ color: '#0000FF'
126
+ });
127
+
128
+ // Add interpretation text
129
+ await toolRegistry.executeTool('geogebra_create_text', {
130
+ text: 'If[a > 0, "Opens upward", "Opens downward"]',
131
+ x: 2,
132
+ y: 6,
133
+ fontSize: 12,
134
+ color: '#AA00AA'
135
+ });
136
+
137
+ await toolRegistry.executeTool('geogebra_create_text', {
138
+ text: 'If[b² - 4*a*c > 0, "Two real roots", If[b² - 4*a*c = 0, "One real root", "No real roots"]]',
139
+ x: 2,
140
+ y: 5,
141
+ fontSize: 12,
142
+ color: '#AA00AA'
143
+ });
144
+
145
+ return {
146
+ construction: 'Interactive quadratic function with adjustable parameters',
147
+ interactivity: 'Adjust sliders a, b, c to see how they affect the parabola',
148
+ concepts: [
149
+ 'Parameter a controls opening direction and width',
150
+ 'Parameter b affects the axis of symmetry location',
151
+ 'Parameter c is the y-intercept',
152
+ 'Vertex form reveals transformations clearly',
153
+ 'Discriminant determines number of x-intercepts'
154
+ ]
155
+ };
156
+ }
157
+ },
158
+
159
+ {
160
+ id: 'linear_systems_graphical',
161
+ name: 'Linear Systems: Graphical Solution',
162
+ category: 'algebra',
163
+ description: 'Visual exploration of linear systems of equations and their solutions through graphing',
164
+ gradeLevel: '8-10',
165
+ objectives: [
166
+ 'Understand that solutions are intersection points',
167
+ 'Explore different types of systems (consistent, inconsistent, dependent)',
168
+ 'Connect algebraic and geometric representations of systems'
169
+ ],
170
+ prerequisites: ['Linear equations', 'Graphing lines', 'Slope-intercept form'],
171
+ estimatedTime: 18,
172
+ setup: async () => {
173
+ // Create sliders for first line: y = m1*x + b1
174
+ await toolRegistry.executeTool('geogebra_create_slider', {
175
+ name: 'm1',
176
+ min: -3,
177
+ max: 3,
178
+ value: 1,
179
+ increment: 0.25,
180
+ x: -8,
181
+ y: 6,
182
+ width: 120,
183
+ caption: 'Slope of Line 1'
184
+ });
185
+
186
+ await toolRegistry.executeTool('geogebra_create_slider', {
187
+ name: 'b1',
188
+ min: -5,
189
+ max: 5,
190
+ value: 2,
191
+ increment: 0.5,
192
+ x: -8,
193
+ y: 5,
194
+ width: 120,
195
+ caption: 'y-intercept of Line 1'
196
+ });
197
+
198
+ // Create sliders for second line: y = m2*x + b2
199
+ await toolRegistry.executeTool('geogebra_create_slider', {
200
+ name: 'm2',
201
+ min: -3,
202
+ max: 3,
203
+ value: -0.5,
204
+ increment: 0.25,
205
+ x: -8,
206
+ y: 4,
207
+ width: 120,
208
+ caption: 'Slope of Line 2'
209
+ });
210
+
211
+ await toolRegistry.executeTool('geogebra_create_slider', {
212
+ name: 'b2',
213
+ min: -5,
214
+ max: 5,
215
+ value: -1,
216
+ increment: 0.5,
217
+ x: -8,
218
+ y: 3,
219
+ width: 120,
220
+ caption: 'y-intercept of Line 2'
221
+ });
222
+
223
+ // Create the two lines
224
+ await toolRegistry.executeTool('geogebra_plot_function', {
225
+ name: 'line1',
226
+ expression: 'm1*x + b1',
227
+ color: '#FF0000',
228
+ thickness: 3,
229
+ style: 'solid'
230
+ });
231
+
232
+ await toolRegistry.executeTool('geogebra_plot_function', {
233
+ name: 'line2',
234
+ expression: 'm2*x + b2',
235
+ color: '#0000FF',
236
+ thickness: 3,
237
+ style: 'solid'
238
+ });
239
+
240
+ // Calculate and show intersection point
241
+ // In real implementation, this would be calculated automatically
242
+ await toolRegistry.executeTool('geogebra_create_point', {
243
+ name: 'intersection',
244
+ x: 2, // Will be (b2-b1)/(m1-m2) in real implementation
245
+ y: 4, // Will be m1*x + b1 at intersection in real implementation
246
+ color: '#00AA00',
247
+ size: 8,
248
+ label: 'Solution'
249
+ });
250
+
251
+ // Add equation displays
252
+ await toolRegistry.executeTool('geogebra_create_text', {
253
+ text: '"Line 1: y = " + m1 + "x + " + b1',
254
+ x: 3,
255
+ y: 6,
256
+ fontSize: 14,
257
+ color: '#FF0000',
258
+ fontStyle: 'bold'
259
+ });
260
+
261
+ await toolRegistry.executeTool('geogebra_create_text', {
262
+ text: '"Line 2: y = " + m2 + "x + " + b2',
263
+ x: 3,
264
+ y: 5,
265
+ fontSize: 14,
266
+ color: '#0000FF',
267
+ fontStyle: 'bold'
268
+ });
269
+
270
+ // Add solution display
271
+ await toolRegistry.executeTool('geogebra_create_text', {
272
+ text: 'If[m1 ≠ m2, "Solution: (" + (b2-b1)/(m1-m2) + ", " + (m1*(b2-b1)/(m1-m2) + b1) + ")", If[b1 = b2, "Infinitely many solutions", "No solution"]]',
273
+ x: 3,
274
+ y: 4,
275
+ fontSize: 14,
276
+ color: '#00AA00',
277
+ fontStyle: 'bold'
278
+ });
279
+
280
+ // Add system type classification
281
+ await toolRegistry.executeTool('geogebra_create_text', {
282
+ text: 'If[m1 ≠ m2, "System Type: Consistent & Independent", If[b1 = b2, "System Type: Consistent & Dependent", "System Type: Inconsistent"]]',
283
+ x: 3,
284
+ y: 3,
285
+ fontSize: 12,
286
+ color: '#AA00AA'
287
+ });
288
+
289
+ // Add slope comparison
290
+ await toolRegistry.executeTool('geogebra_create_text', {
291
+ text: 'If[m1 = m2, "Lines are parallel", "Lines intersect"]',
292
+ x: 3,
293
+ y: 2,
294
+ fontSize: 12,
295
+ color: '#666666'
296
+ });
297
+
298
+ return {
299
+ construction: 'Two adjustable linear functions with intersection point',
300
+ interactivity: 'Adjust slopes and y-intercepts to explore different system types',
301
+ systemTypes: [
302
+ 'Consistent & Independent: Different slopes → unique solution',
303
+ 'Consistent & Dependent: Same line → infinitely many solutions',
304
+ 'Inconsistent: Parallel but different → no solution'
305
+ ]
306
+ };
307
+ }
308
+ },
309
+
310
+ {
311
+ id: 'exponential_growth_decay',
312
+ name: 'Exponential Functions: Growth and Decay',
313
+ category: 'algebra',
314
+ description: 'Interactive exploration of exponential functions, including growth, decay, and real-world applications',
315
+ gradeLevel: '9-12',
316
+ objectives: [
317
+ 'Understand exponential function behavior',
318
+ 'Distinguish between growth and decay',
319
+ 'Explore effects of base and initial value',
320
+ 'Connect to real-world scenarios'
321
+ ],
322
+ prerequisites: ['Function notation', 'Basic graphing', 'Exponent rules'],
323
+ estimatedTime: 22,
324
+ setup: async () => {
325
+ // Create sliders for exponential function y = a * b^x
326
+ await toolRegistry.executeTool('geogebra_create_slider', {
327
+ name: 'a',
328
+ min: 0.1,
329
+ max: 5,
330
+ value: 1,
331
+ increment: 0.1,
332
+ x: -8,
333
+ y: 6,
334
+ width: 120,
335
+ caption: 'Initial Value (a)'
336
+ });
337
+
338
+ await toolRegistry.executeTool('geogebra_create_slider', {
339
+ name: 'b',
340
+ min: 0.1,
341
+ max: 3,
342
+ value: 2,
343
+ increment: 0.1,
344
+ x: -8,
345
+ y: 5,
346
+ width: 120,
347
+ caption: 'Base (b)'
348
+ });
349
+
350
+ // Create the exponential function
351
+ await toolRegistry.executeTool('geogebra_plot_function', {
352
+ name: 'exponential',
353
+ expression: 'a * b^x',
354
+ color: '#FF0000',
355
+ thickness: 3,
356
+ xMin: -5,
357
+ xMax: 5
358
+ });
359
+
360
+ // Add horizontal asymptote
361
+ await toolRegistry.executeTool('geogebra_create_line', {
362
+ name: 'asymptote',
363
+ type: 'horizontal',
364
+ value: 0,
365
+ color: '#666666',
366
+ thickness: 1,
367
+ style: 'dashed'
368
+ });
369
+
370
+ // Add y-intercept point
371
+ await toolRegistry.executeTool('geogebra_create_point', {
372
+ name: 'yIntercept',
373
+ x: 0,
374
+ y: 1, // Will be 'a' in real implementation
375
+ color: '#00AA00',
376
+ size: 6,
377
+ label: 'y-intercept'
378
+ });
379
+
380
+ // Create comparison points to show growth/decay
381
+ await toolRegistry.executeTool('geogebra_create_point', {
382
+ name: 'point1',
383
+ x: 1,
384
+ y: 2, // Will be a*b^1 in real implementation
385
+ color: '#0000FF',
386
+ size: 4,
387
+ label: 'f(1)'
388
+ });
389
+
390
+ await toolRegistry.executeTool('geogebra_create_point', {
391
+ name: 'point2',
392
+ x: 2,
393
+ y: 4, // Will be a*b^2 in real implementation
394
+ color: '#0000FF',
395
+ size: 4,
396
+ label: 'f(2)'
397
+ });
398
+
399
+ // Add function equation display
400
+ await toolRegistry.executeTool('geogebra_create_text', {
401
+ text: '"f(x) = " + a + " × " + b + "^x"',
402
+ x: 3,
403
+ y: 6,
404
+ fontSize: 16,
405
+ color: '#FF0000',
406
+ fontStyle: 'bold'
407
+ });
408
+
409
+ // Add growth/decay classification
410
+ await toolRegistry.executeTool('geogebra_create_text', {
411
+ text: 'If[b > 1, "EXPONENTIAL GROWTH", If[b = 1, "CONSTANT FUNCTION", "EXPONENTIAL DECAY"]]',
412
+ x: 3,
413
+ y: 5,
414
+ fontSize: 14,
415
+ color: '#00AA00',
416
+ fontStyle: 'bold'
417
+ });
418
+
419
+ // Add growth factor information
420
+ await toolRegistry.executeTool('geogebra_create_text', {
421
+ text: 'If[b > 1, "Growth Factor: " + b + " (increases by " + (100*(b-1)) + "% each unit)", "Decay Factor: " + b + " (decreases by " + (100*(1-b)) + "% each unit)"]',
422
+ x: 3,
423
+ y: 4,
424
+ fontSize: 12,
425
+ color: '#0000FF'
426
+ });
427
+
428
+ // Add doubling/halving time (approximate)
429
+ await toolRegistry.executeTool('geogebra_create_text', {
430
+ text: 'If[b > 1, "Doubling time ≈ " + ln(2)/ln(b) + " units", "Half-life ≈ " + ln(0.5)/ln(b) + " units"]',
431
+ x: 3,
432
+ y: 3,
433
+ fontSize: 12,
434
+ color: '#AA00AA'
435
+ });
436
+
437
+ // Add real-world examples
438
+ await toolRegistry.executeTool('geogebra_create_text', {
439
+ text: 'If[b > 1, "Examples: Population growth, compound interest, bacterial growth", "Examples: Radioactive decay, depreciation, cooling"]',
440
+ x: 3,
441
+ y: 2,
442
+ fontSize: 11,
443
+ color: '#666666'
444
+ });
445
+
446
+ return {
447
+ construction: 'Interactive exponential function with adjustable parameters',
448
+ interactivity: 'Adjust initial value (a) and base (b) to explore growth and decay',
449
+ concepts: [
450
+ 'Base b > 1: exponential growth',
451
+ 'Base 0 < b < 1: exponential decay',
452
+ 'Parameter a determines y-intercept and scale',
453
+ 'Horizontal asymptote at y = 0',
454
+ 'Real-world applications vary by context'
455
+ ]
456
+ };
457
+ }
458
+ },
459
+
460
+ {
461
+ id: 'polynomial_factoring',
462
+ name: 'Polynomial Factoring Visualizer',
463
+ category: 'algebra',
464
+ description: 'Visual exploration of polynomial factoring, showing the relationship between factors and zeros',
465
+ gradeLevel: '9-12',
466
+ objectives: [
467
+ 'Connect factored form to graph zeros',
468
+ 'Understand multiplicity effects on graph behavior',
469
+ 'Explore relationship between factors and x-intercepts'
470
+ ],
471
+ prerequisites: ['Polynomial basics', 'Factoring techniques', 'Function graphing'],
472
+ estimatedTime: 20,
473
+ setup: async () => {
474
+ // Create sliders for factors (x - r1)(x - r2)(x - r3)
475
+ await toolRegistry.executeTool('geogebra_create_slider', {
476
+ name: 'r1',
477
+ min: -5,
478
+ max: 5,
479
+ value: -2,
480
+ increment: 0.5,
481
+ x: -8,
482
+ y: 6,
483
+ width: 120,
484
+ caption: 'Zero 1 (r₁)'
485
+ });
486
+
487
+ await toolRegistry.executeTool('geogebra_create_slider', {
488
+ name: 'r2',
489
+ min: -5,
490
+ max: 5,
491
+ value: 1,
492
+ increment: 0.5,
493
+ x: -8,
494
+ y: 5,
495
+ width: 120,
496
+ caption: 'Zero 2 (r₂)'
497
+ });
498
+
499
+ await toolRegistry.executeTool('geogebra_create_slider', {
500
+ name: 'r3',
501
+ min: -5,
502
+ max: 5,
503
+ value: 3,
504
+ increment: 0.5,
505
+ x: -8,
506
+ y: 4,
507
+ width: 120,
508
+ caption: 'Zero 3 (r₃)'
509
+ });
510
+
511
+ // Create leading coefficient slider
512
+ await toolRegistry.executeTool('geogebra_create_slider', {
513
+ name: 'leadCoeff',
514
+ min: -2,
515
+ max: 2,
516
+ value: 1,
517
+ increment: 0.25,
518
+ x: -8,
519
+ y: 3,
520
+ width: 120,
521
+ caption: 'Leading Coefficient'
522
+ });
523
+
524
+ // Create the polynomial function
525
+ await toolRegistry.executeTool('geogebra_plot_function', {
526
+ name: 'polynomial',
527
+ expression: 'leadCoeff * (x - r1) * (x - r2) * (x - r3)',
528
+ color: '#FF0000',
529
+ thickness: 3,
530
+ xMin: -6,
531
+ xMax: 6
532
+ });
533
+
534
+ // Mark the zeros on the x-axis
535
+ await toolRegistry.executeTool('geogebra_create_point', {
536
+ name: 'zero1',
537
+ x: -2, // Will be r1 in real implementation
538
+ y: 0,
539
+ color: '#00AA00',
540
+ size: 6,
541
+ label: 'r₁'
542
+ });
543
+
544
+ await toolRegistry.executeTool('geogebra_create_point', {
545
+ name: 'zero2',
546
+ x: 1, // Will be r2 in real implementation
547
+ y: 0,
548
+ color: '#00AA00',
549
+ size: 6,
550
+ label: 'r₂'
551
+ });
552
+
553
+ await toolRegistry.executeTool('geogebra_create_point', {
554
+ name: 'zero3',
555
+ x: 3, // Will be r3 in real implementation
556
+ y: 0,
557
+ color: '#00AA00',
558
+ size: 6,
559
+ label: 'r₃'
560
+ });
561
+
562
+ // Add factored form display
563
+ await toolRegistry.executeTool('geogebra_create_text', {
564
+ text: '"Factored Form: f(x) = " + leadCoeff + "(x - " + r1 + ")(x - " + r2 + ")(x - " + r3 + ")"',
565
+ x: 2,
566
+ y: 6,
567
+ fontSize: 14,
568
+ color: '#FF0000',
569
+ fontStyle: 'bold'
570
+ });
571
+
572
+ // Add zeros list
573
+ await toolRegistry.executeTool('geogebra_create_text', {
574
+ text: '"Zeros: x = " + r1 + ", x = " + r2 + ", x = " + r3',
575
+ x: 2,
576
+ y: 5,
577
+ fontSize: 14,
578
+ color: '#00AA00'
579
+ });
580
+
581
+ // Add degree and leading coefficient info
582
+ await toolRegistry.executeTool('geogebra_create_text', {
583
+ text: '"Degree: 3 (cubic polynomial)"',
584
+ x: 2,
585
+ y: 4,
586
+ fontSize: 12,
587
+ color: '#0000FF'
588
+ });
589
+
590
+ await toolRegistry.executeTool('geogebra_create_text', {
591
+ text: 'If[leadCoeff > 0, "Leading coefficient positive: rises to right", "Leading coefficient negative: falls to right"]',
592
+ x: 2,
593
+ y: 3,
594
+ fontSize: 12,
595
+ color: '#0000FF'
596
+ });
597
+
598
+ // Add behavior description
599
+ await toolRegistry.executeTool('geogebra_create_text', {
600
+ text: '"The graph crosses the x-axis at each zero"',
601
+ x: 2,
602
+ y: 2,
603
+ fontSize: 12,
604
+ color: '#AA00AA'
605
+ });
606
+
607
+ return {
608
+ construction: 'Cubic polynomial in factored form with adjustable zeros',
609
+ interactivity: 'Move zeros r₁, r₂, r₃ and adjust leading coefficient',
610
+ concepts: [
611
+ 'Zeros of polynomial are x-intercepts of graph',
612
+ 'Factored form directly shows zeros',
613
+ 'Leading coefficient affects vertical scaling and end behavior',
614
+ 'Number of zeros ≤ degree of polynomial'
615
+ ]
616
+ };
617
+ }
618
+ }
619
+ ];