@classytic/labs 0.1.0

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 (547) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/dist/biology/enzyme-rate/index.d.mts +1 -0
  4. package/dist/biology/enzyme-rate/preset.d.mts +25 -0
  5. package/dist/biology/enzyme-rate/preset.mjs +256 -0
  6. package/dist/biology/genetic-cross/core.d.mts +64 -0
  7. package/dist/biology/genetic-cross/core.mjs +147 -0
  8. package/dist/biology/genetic-cross/grid.mjs +239 -0
  9. package/dist/biology/genetic-cross/index.d.mts +3 -0
  10. package/dist/biology/genetic-cross/preset.d.mts +26 -0
  11. package/dist/biology/genetic-cross/preset.mjs +184 -0
  12. package/dist/biology/genetic-cross/sex-linked.d.mts +27 -0
  13. package/dist/biology/genetic-cross/sex-linked.mjs +226 -0
  14. package/dist/biology/index.d.mts +11 -0
  15. package/dist/biology/index.mjs +12 -0
  16. package/dist/biology/photosynthesis-factors/index.d.mts +1 -0
  17. package/dist/biology/photosynthesis-factors/preset.d.mts +25 -0
  18. package/dist/biology/photosynthesis-factors/preset.mjs +270 -0
  19. package/dist/biology/punnett-cross/index.d.mts +1 -0
  20. package/dist/biology/punnett-cross/preset.d.mts +27 -0
  21. package/dist/biology/punnett-cross/preset.mjs +21 -0
  22. package/dist/biology/respiration/index.d.mts +1 -0
  23. package/dist/biology/respiration/preset.d.mts +17 -0
  24. package/dist/biology/respiration/preset.mjs +179 -0
  25. package/dist/biology/sequence/central-dogma.d.mts +17 -0
  26. package/dist/biology/sequence/central-dogma.mjs +339 -0
  27. package/dist/biology/sequence/core.d.mts +38 -0
  28. package/dist/biology/sequence/core.mjs +178 -0
  29. package/dist/biology/sequence/index.d.mts +3 -0
  30. package/dist/biology/sequence/preset.d.mts +20 -0
  31. package/dist/biology/sequence/preset.mjs +235 -0
  32. package/dist/blocks/accounting.d.mts +142 -0
  33. package/dist/blocks/accounting.mjs +446 -0
  34. package/dist/blocks/authoring.d.mts +12 -0
  35. package/dist/blocks/authoring.mjs +705 -0
  36. package/dist/blocks/biology.d.mts +197 -0
  37. package/dist/blocks/biology.mjs +513 -0
  38. package/dist/blocks/chem.d.mts +128 -0
  39. package/dist/blocks/chem.mjs +486 -0
  40. package/dist/blocks/circuits.d.mts +86 -0
  41. package/dist/blocks/circuits.mjs +348 -0
  42. package/dist/blocks/discrete.d.mts +62 -0
  43. package/dist/blocks/discrete.mjs +314 -0
  44. package/dist/blocks/economics.d.mts +56 -0
  45. package/dist/blocks/economics.mjs +203 -0
  46. package/dist/blocks/geography.d.mts +58 -0
  47. package/dist/blocks/geography.mjs +115 -0
  48. package/dist/blocks/geometry.d.mts +28 -0
  49. package/dist/blocks/geometry.mjs +160 -0
  50. package/dist/blocks/ict.d.mts +65 -0
  51. package/dist/blocks/ict.mjs +197 -0
  52. package/dist/blocks/index.d.mts +4555 -0
  53. package/dist/blocks/index.mjs +120 -0
  54. package/dist/blocks/lab-block.d.mts +16 -0
  55. package/dist/blocks/lab-block.mjs +74 -0
  56. package/dist/blocks/lab-config.d.mts +23 -0
  57. package/dist/blocks/lab-config.mjs +200 -0
  58. package/dist/blocks/lab-gallery.d.mts +30 -0
  59. package/dist/blocks/lab-gallery.mjs +208 -0
  60. package/dist/blocks/language.d.mts +349 -0
  61. package/dist/blocks/language.mjs +750 -0
  62. package/dist/blocks/lesson.d.mts +43 -0
  63. package/dist/blocks/lesson.mjs +140 -0
  64. package/dist/blocks/math.d.mts +411 -0
  65. package/dist/blocks/math.mjs +1536 -0
  66. package/dist/blocks/ml.d.mts +84 -0
  67. package/dist/blocks/ml.mjs +146 -0
  68. package/dist/blocks/physics.d.mts +259 -0
  69. package/dist/blocks/physics.mjs +868 -0
  70. package/dist/blocks/statistics.d.mts +29 -0
  71. package/dist/blocks/statistics.mjs +123 -0
  72. package/dist/catalog/index.d.mts +3 -0
  73. package/dist/catalog/index.mjs +8 -0
  74. package/dist/catalog/registry.d.mts +46 -0
  75. package/dist/catalog/registry.mjs +56 -0
  76. package/dist/catalog/templates.d.mts +11 -0
  77. package/dist/catalog/templates.mjs +141 -0
  78. package/dist/chem/battery.d.mts +16 -0
  79. package/dist/chem/battery.mjs +311 -0
  80. package/dist/chem/bohr-atom.d.mts +16 -0
  81. package/dist/chem/bohr-atom.mjs +212 -0
  82. package/dist/chem/diffusion/asset.mjs +76 -0
  83. package/dist/chem/diffusion/index.d.mts +1 -0
  84. package/dist/chem/diffusion/preset.d.mts +15 -0
  85. package/dist/chem/diffusion/preset.mjs +188 -0
  86. package/dist/chem/electrochem/index.d.mts +1 -0
  87. package/dist/chem/electrochem/preset.d.mts +23 -0
  88. package/dist/chem/electrochem/preset.mjs +402 -0
  89. package/dist/chem/equilibrium/index.d.mts +1 -0
  90. package/dist/chem/equilibrium/preset.d.mts +36 -0
  91. package/dist/chem/equilibrium/preset.mjs +416 -0
  92. package/dist/chem/gas-box/index.d.mts +1 -0
  93. package/dist/chem/gas-box/preset.d.mts +27 -0
  94. package/dist/chem/gas-box/preset.mjs +395 -0
  95. package/dist/chem/index.d.mts +16 -0
  96. package/dist/chem/index.mjs +17 -0
  97. package/dist/chem/kinetics/index.d.mts +1 -0
  98. package/dist/chem/kinetics/preset.d.mts +31 -0
  99. package/dist/chem/kinetics/preset.mjs +478 -0
  100. package/dist/chem/periodic-trends/index.d.mts +1 -0
  101. package/dist/chem/periodic-trends/preset.d.mts +21 -0
  102. package/dist/chem/periodic-trends/preset.mjs +831 -0
  103. package/dist/chem/reaction-lab.d.mts +18 -0
  104. package/dist/chem/reaction-lab.mjs +165 -0
  105. package/dist/chem/reaction-profile.d.mts +21 -0
  106. package/dist/chem/reaction-profile.mjs +287 -0
  107. package/dist/chem/solution/dilution.d.mts +27 -0
  108. package/dist/chem/solution/dilution.mjs +199 -0
  109. package/dist/chem/solution/field.d.mts +30 -0
  110. package/dist/chem/solution/field.mjs +145 -0
  111. package/dist/chem/solution/index.d.mts +3 -0
  112. package/dist/chem/solution/solution-box.d.mts +28 -0
  113. package/dist/chem/solution/solution-box.mjs +140 -0
  114. package/dist/chem/stoichiometry/index.d.mts +1 -0
  115. package/dist/chem/stoichiometry/preset.d.mts +29 -0
  116. package/dist/chem/stoichiometry/preset.mjs +392 -0
  117. package/dist/chem/titration/index.d.mts +1 -0
  118. package/dist/chem/titration/preset.d.mts +29 -0
  119. package/dist/chem/titration/preset.mjs +436 -0
  120. package/dist/circuits/ac-dc/asset.mjs +295 -0
  121. package/dist/circuits/ac-dc/index.d.mts +1 -0
  122. package/dist/circuits/ac-dc/preset.d.mts +16 -0
  123. package/dist/circuits/ac-dc/preset.mjs +134 -0
  124. package/dist/circuits/capacitor-leak/index.d.mts +1 -0
  125. package/dist/circuits/capacitor-leak/preset.d.mts +32 -0
  126. package/dist/circuits/capacitor-leak/preset.mjs +271 -0
  127. package/dist/circuits/circuit/asset.d.mts +6 -0
  128. package/dist/circuits/circuit/asset.mjs +367 -0
  129. package/dist/circuits/circuit/index.d.mts +2 -0
  130. package/dist/circuits/circuit/preset.d.mts +46 -0
  131. package/dist/circuits/circuit/preset.mjs +235 -0
  132. package/dist/circuits/circuit-builder.d.mts +30 -0
  133. package/dist/circuits/circuit-builder.mjs +412 -0
  134. package/dist/circuits/circuit-lab.d.mts +20 -0
  135. package/dist/circuits/circuit-lab.mjs +400 -0
  136. package/dist/circuits/index.d.mts +7 -0
  137. package/dist/circuits/index.mjs +8 -0
  138. package/dist/commerce/accounting/core.d.mts +48 -0
  139. package/dist/commerce/accounting/core.mjs +57 -0
  140. package/dist/commerce/accounting/equation-balance.d.mts +35 -0
  141. package/dist/commerce/accounting/equation-balance.mjs +292 -0
  142. package/dist/commerce/accounting/index.d.mts +4 -0
  143. package/dist/commerce/accounting/journal-poster.d.mts +29 -0
  144. package/dist/commerce/accounting/journal-poster.mjs +472 -0
  145. package/dist/commerce/accounting/statement-sorter.d.mts +25 -0
  146. package/dist/commerce/accounting/statement-sorter.mjs +304 -0
  147. package/dist/commerce/economics/core.d.mts +33 -0
  148. package/dist/commerce/economics/core.mjs +26 -0
  149. package/dist/commerce/economics/demand-shift-vs-move.d.mts +35 -0
  150. package/dist/commerce/economics/demand-shift-vs-move.mjs +324 -0
  151. package/dist/commerce/economics/elasticity-revenue.d.mts +31 -0
  152. package/dist/commerce/economics/elasticity-revenue.mjs +253 -0
  153. package/dist/commerce/economics/index.d.mts +4 -0
  154. package/dist/commerce/economics/market-equilibrium.d.mts +33 -0
  155. package/dist/commerce/economics/market-equilibrium.mjs +340 -0
  156. package/dist/commerce/index.d.mts +9 -0
  157. package/dist/commerce/index.mjs +10 -0
  158. package/dist/core/easing.d.mts +28 -0
  159. package/dist/core/easing.mjs +66 -0
  160. package/dist/core/index.d.mts +10 -0
  161. package/dist/core/index.mjs +11 -0
  162. package/dist/core/numeric.d.mts +37 -0
  163. package/dist/core/numeric.mjs +75 -0
  164. package/dist/core/reactive.d.mts +24 -0
  165. package/dist/core/reactive.mjs +51 -0
  166. package/dist/core/rng.d.mts +21 -0
  167. package/dist/core/rng.mjs +39 -0
  168. package/dist/core/tex.d.mts +14 -0
  169. package/dist/core/tex.mjs +44 -0
  170. package/dist/core/timeline.d.mts +34 -0
  171. package/dist/core/timeline.mjs +77 -0
  172. package/dist/core/util.d.mts +19 -0
  173. package/dist/core/util.mjs +31 -0
  174. package/dist/discrete/arrangements/preset.d.mts +28 -0
  175. package/dist/discrete/arrangements/preset.mjs +304 -0
  176. package/dist/discrete/bayes/preset.d.mts +33 -0
  177. package/dist/discrete/bayes/preset.mjs +476 -0
  178. package/dist/discrete/binomial/preset.d.mts +25 -0
  179. package/dist/discrete/binomial/preset.mjs +333 -0
  180. package/dist/discrete/core/combinatorics.d.mts +23 -0
  181. package/dist/discrete/core/combinatorics.mjs +57 -0
  182. package/dist/discrete/core/inclusionExclusion.d.mts +19 -0
  183. package/dist/discrete/core/inclusionExclusion.mjs +30 -0
  184. package/dist/discrete/core/pigeonhole.d.mts +15 -0
  185. package/dist/discrete/core/pigeonhole.mjs +24 -0
  186. package/dist/discrete/core/probability.d.mts +29 -0
  187. package/dist/discrete/core/probability.mjs +43 -0
  188. package/dist/discrete/core/sets.d.mts +21 -0
  189. package/dist/discrete/core/sets.mjs +45 -0
  190. package/dist/discrete/counting-slots/preset.d.mts +30 -0
  191. package/dist/discrete/counting-slots/preset.mjs +553 -0
  192. package/dist/discrete/counting-tree/index.d.mts +1 -0
  193. package/dist/discrete/counting-tree/preset.d.mts +44 -0
  194. package/dist/discrete/counting-tree/preset.mjs +364 -0
  195. package/dist/discrete/expected-value/preset.d.mts +28 -0
  196. package/dist/discrete/expected-value/preset.mjs +352 -0
  197. package/dist/discrete/hypergeometric/preset.d.mts +25 -0
  198. package/dist/discrete/hypergeometric/preset.mjs +330 -0
  199. package/dist/discrete/index.d.mts +26 -0
  200. package/dist/discrete/index.mjs +27 -0
  201. package/dist/discrete/karnaugh/index.d.mts +1 -0
  202. package/dist/discrete/karnaugh/preset.d.mts +30 -0
  203. package/dist/discrete/karnaugh/preset.mjs +452 -0
  204. package/dist/discrete/lln/asset.mjs +206 -0
  205. package/dist/discrete/lln/index.d.mts +1 -0
  206. package/dist/discrete/lln/preset.d.mts +17 -0
  207. package/dist/discrete/lln/preset.mjs +152 -0
  208. package/dist/discrete/logic-circuit/index.d.mts +1 -0
  209. package/dist/discrete/logic-circuit/preset.d.mts +47 -0
  210. package/dist/discrete/logic-circuit/preset.mjs +307 -0
  211. package/dist/discrete/monte-carlo/index.d.mts +1 -0
  212. package/dist/discrete/monte-carlo/preset.d.mts +64 -0
  213. package/dist/discrete/monte-carlo/preset.mjs +446 -0
  214. package/dist/discrete/monty-hall/index.d.mts +1 -0
  215. package/dist/discrete/monty-hall/preset.d.mts +23 -0
  216. package/dist/discrete/monty-hall/preset.mjs +491 -0
  217. package/dist/discrete/outcome-builder/preset.d.mts +24 -0
  218. package/dist/discrete/outcome-builder/preset.mjs +283 -0
  219. package/dist/discrete/pascal/preset.d.mts +24 -0
  220. package/dist/discrete/pascal/preset.mjs +372 -0
  221. package/dist/discrete/sample-space/index.d.mts +1 -0
  222. package/dist/discrete/sample-space/preset.d.mts +42 -0
  223. package/dist/discrete/sample-space/preset.mjs +395 -0
  224. package/dist/discrete/selection/preset.d.mts +33 -0
  225. package/dist/discrete/selection/preset.mjs +406 -0
  226. package/dist/discrete/truth-table/index.d.mts +1 -0
  227. package/dist/discrete/truth-table/preset.d.mts +30 -0
  228. package/dist/discrete/truth-table/preset.mjs +456 -0
  229. package/dist/discrete/venn/index.d.mts +1 -0
  230. package/dist/discrete/venn/preset.d.mts +32 -0
  231. package/dist/discrete/venn/preset.mjs +461 -0
  232. package/dist/geography/cycle-lab/index.d.mts +1 -0
  233. package/dist/geography/cycle-lab/preset.d.mts +25 -0
  234. package/dist/geography/cycle-lab/preset.mjs +254 -0
  235. package/dist/geography/cycles.d.mts +21 -0
  236. package/dist/geography/cycles.mjs +205 -0
  237. package/dist/geography/index.d.mts +4 -0
  238. package/dist/geography/index.mjs +5 -0
  239. package/dist/geometry/board/index.d.mts +1 -0
  240. package/dist/geometry/board/preset.d.mts +71 -0
  241. package/dist/geometry/board/preset.mjs +148 -0
  242. package/dist/geometry/builder.d.mts +18 -0
  243. package/dist/geometry/builder.mjs +332 -0
  244. package/dist/geometry/index.d.mts +4 -0
  245. package/dist/geometry/index.mjs +5 -0
  246. package/dist/geometry/intersecting-circles.d.mts +17 -0
  247. package/dist/geometry/intersecting-circles.mjs +104 -0
  248. package/dist/ict/index.d.mts +5 -0
  249. package/dist/ict/index.mjs +6 -0
  250. package/dist/ict/number-systems/base-odometer.d.mts +34 -0
  251. package/dist/ict/number-systems/base-odometer.mjs +160 -0
  252. package/dist/ict/number-systems/bit-grouper.d.mts +32 -0
  253. package/dist/ict/number-systems/bit-grouper.mjs +190 -0
  254. package/dist/ict/number-systems/index.d.mts +4 -0
  255. package/dist/ict/number-systems/place-value-dial.d.mts +29 -0
  256. package/dist/ict/number-systems/place-value-dial.mjs +153 -0
  257. package/dist/ict/number-systems/wheel.d.mts +73 -0
  258. package/dist/ict/number-systems/wheel.mjs +279 -0
  259. package/dist/index.d.mts +10 -0
  260. package/dist/index.mjs +11 -0
  261. package/dist/kit/anim.mjs +52 -0
  262. package/dist/kit/annotate.mjs +116 -0
  263. package/dist/kit/answer-check.d.mts +38 -0
  264. package/dist/kit/answer-check.mjs +65 -0
  265. package/dist/kit/asset-util.mjs +15 -0
  266. package/dist/kit/controls.mjs +77 -0
  267. package/dist/kit/cycle.d.mts +44 -0
  268. package/dist/kit/cycle.mjs +188 -0
  269. package/dist/kit/diagram.mjs +176 -0
  270. package/dist/kit/electronics.mjs +357 -0
  271. package/dist/kit/expr-analysis.d.mts +37 -0
  272. package/dist/kit/expr-analysis.mjs +111 -0
  273. package/dist/kit/frame.d.mts +70 -0
  274. package/dist/kit/frame.mjs +205 -0
  275. package/dist/kit/freq-tree.mjs +99 -0
  276. package/dist/kit/gameshow.mjs +315 -0
  277. package/dist/kit/index.d.mts +5 -0
  278. package/dist/kit/index.mjs +6 -0
  279. package/dist/kit/logic-gates.d.mts +6 -0
  280. package/dist/kit/logic-gates.mjs +210 -0
  281. package/dist/kit/molecules.mjs +178 -0
  282. package/dist/kit/pedagogy.d.mts +126 -0
  283. package/dist/kit/pedagogy.mjs +331 -0
  284. package/dist/kit/play.d.mts +21 -0
  285. package/dist/kit/play.mjs +52 -0
  286. package/dist/kit/probability.mjs +141 -0
  287. package/dist/kit/proportion.mjs +112 -0
  288. package/dist/kit/reaction.mjs +102 -0
  289. package/dist/kit/rich.d.mts +10 -0
  290. package/dist/kit/rich.mjs +21 -0
  291. package/dist/kit/scale.mjs +230 -0
  292. package/dist/kit/space.mjs +326 -0
  293. package/dist/kit/steps.d.mts +24 -0
  294. package/dist/kit/steps.mjs +57 -0
  295. package/dist/kit/thermal.mjs +289 -0
  296. package/dist/language/agreement/index.d.mts +1 -0
  297. package/dist/language/agreement/preset.d.mts +27 -0
  298. package/dist/language/agreement/preset.mjs +113 -0
  299. package/dist/language/article-lens/index.d.mts +1 -0
  300. package/dist/language/article-lens/preset.d.mts +31 -0
  301. package/dist/language/article-lens/preset.mjs +125 -0
  302. package/dist/language/deck.d.mts +45 -0
  303. package/dist/language/deck.mjs +61 -0
  304. package/dist/language/icon.d.mts +40 -0
  305. package/dist/language/icon.mjs +73 -0
  306. package/dist/language/index.d.mts +10 -0
  307. package/dist/language/index.mjs +11 -0
  308. package/dist/language/preposition-scene/index.d.mts +1 -0
  309. package/dist/language/preposition-scene/preset.d.mts +34 -0
  310. package/dist/language/preposition-scene/preset.mjs +234 -0
  311. package/dist/language/sentence-builder/index.d.mts +1 -0
  312. package/dist/language/sentence-builder/preset.d.mts +32 -0
  313. package/dist/language/sentence-builder/preset.mjs +122 -0
  314. package/dist/language/transform/index.d.mts +1 -0
  315. package/dist/language/transform/preset.d.mts +31 -0
  316. package/dist/language/transform/preset.mjs +137 -0
  317. package/dist/language/ui.d.mts +53 -0
  318. package/dist/language/ui.mjs +88 -0
  319. package/dist/language/word-match/index.d.mts +1 -0
  320. package/dist/language/word-match/preset.d.mts +22 -0
  321. package/dist/language/word-match/preset.mjs +148 -0
  322. package/dist/math/area-model/asset.d.mts +6 -0
  323. package/dist/math/area-model/asset.mjs +270 -0
  324. package/dist/math/area-model/index.d.mts +2 -0
  325. package/dist/math/area-model/preset.d.mts +29 -0
  326. package/dist/math/area-model/preset.mjs +243 -0
  327. package/dist/math/balance-algebra/asset.d.mts +6 -0
  328. package/dist/math/balance-algebra/asset.mjs +150 -0
  329. package/dist/math/balance-algebra/index.d.mts +2 -0
  330. package/dist/math/balance-algebra/preset.d.mts +30 -0
  331. package/dist/math/balance-algebra/preset.mjs +228 -0
  332. package/dist/math/derivation.d.mts +22 -0
  333. package/dist/math/derivation.mjs +113 -0
  334. package/dist/math/derivative-explorer/index.d.mts +1 -0
  335. package/dist/math/derivative-explorer/preset.d.mts +19 -0
  336. package/dist/math/derivative-explorer/preset.mjs +227 -0
  337. package/dist/math/function-machine/index.d.mts +1 -0
  338. package/dist/math/function-machine/preset.d.mts +21 -0
  339. package/dist/math/function-machine/preset.mjs +177 -0
  340. package/dist/math/gradient-descent.d.mts +23 -0
  341. package/dist/math/gradient-descent.mjs +473 -0
  342. package/dist/math/grapher/index.d.mts +1 -0
  343. package/dist/math/grapher/preset.d.mts +40 -0
  344. package/dist/math/grapher/preset.mjs +313 -0
  345. package/dist/math/harmonic-form/index.d.mts +1 -0
  346. package/dist/math/harmonic-form/preset.d.mts +21 -0
  347. package/dist/math/harmonic-form/preset.mjs +387 -0
  348. package/dist/math/index.d.mts +25 -0
  349. package/dist/math/index.mjs +26 -0
  350. package/dist/math/integral-explorer/index.d.mts +1 -0
  351. package/dist/math/integral-explorer/preset.d.mts +23 -0
  352. package/dist/math/integral-explorer/preset.mjs +217 -0
  353. package/dist/math/interactive/index.d.mts +1 -0
  354. package/dist/math/interactive/preset.d.mts +72 -0
  355. package/dist/math/interactive/preset.mjs +202 -0
  356. package/dist/math/limit-explorer/index.d.mts +1 -0
  357. package/dist/math/limit-explorer/preset.d.mts +19 -0
  358. package/dist/math/limit-explorer/preset.mjs +216 -0
  359. package/dist/math/linear-system/index.d.mts +1 -0
  360. package/dist/math/linear-system/preset.d.mts +28 -0
  361. package/dist/math/linear-system/preset.mjs +164 -0
  362. package/dist/math/mystery-bucket/asset.d.mts +6 -0
  363. package/dist/math/mystery-bucket/asset.mjs +145 -0
  364. package/dist/math/mystery-bucket/index.d.mts +2 -0
  365. package/dist/math/mystery-bucket/preset.d.mts +36 -0
  366. package/dist/math/mystery-bucket/preset.mjs +116 -0
  367. package/dist/math/number-line/index.d.mts +1 -0
  368. package/dist/math/number-line/preset.d.mts +24 -0
  369. package/dist/math/number-line/preset.mjs +142 -0
  370. package/dist/math/parabola/index.d.mts +1 -0
  371. package/dist/math/parabola/preset.d.mts +13 -0
  372. package/dist/math/parabola/preset.mjs +79 -0
  373. package/dist/math/pattern/asset.d.mts +6 -0
  374. package/dist/math/pattern/asset.mjs +102 -0
  375. package/dist/math/pattern/index.d.mts +2 -0
  376. package/dist/math/pattern/preset.d.mts +32 -0
  377. package/dist/math/pattern/preset.mjs +294 -0
  378. package/dist/math/triangle-trig/index.d.mts +1 -0
  379. package/dist/math/triangle-trig/preset.d.mts +47 -0
  380. package/dist/math/triangle-trig/preset.mjs +245 -0
  381. package/dist/math/trig-explorer.d.mts +18 -0
  382. package/dist/math/trig-explorer.mjs +209 -0
  383. package/dist/ml/boundary/index.d.mts +1 -0
  384. package/dist/ml/boundary/preset.d.mts +24 -0
  385. package/dist/ml/boundary/preset.mjs +385 -0
  386. package/dist/ml/classifier/index.d.mts +1 -0
  387. package/dist/ml/classifier/preset.d.mts +25 -0
  388. package/dist/ml/classifier/preset.mjs +315 -0
  389. package/dist/ml/index.d.mts +6 -0
  390. package/dist/ml/index.mjs +7 -0
  391. package/dist/ml/kmeans/index.d.mts +1 -0
  392. package/dist/ml/kmeans/preset.d.mts +33 -0
  393. package/dist/ml/kmeans/preset.mjs +236 -0
  394. package/dist/ml/knn/index.d.mts +1 -0
  395. package/dist/ml/knn/preset.d.mts +28 -0
  396. package/dist/ml/knn/preset.mjs +279 -0
  397. package/dist/ml/regression/index.d.mts +1 -0
  398. package/dist/ml/regression/preset.d.mts +32 -0
  399. package/dist/ml/regression/preset.mjs +394 -0
  400. package/dist/physics/atwood/index.d.mts +1 -0
  401. package/dist/physics/atwood/preset.d.mts +23 -0
  402. package/dist/physics/atwood/preset.mjs +312 -0
  403. package/dist/physics/bullet-walls/index.d.mts +1 -0
  404. package/dist/physics/bullet-walls/preset.d.mts +28 -0
  405. package/dist/physics/bullet-walls/preset.mjs +373 -0
  406. package/dist/physics/carnot/index.d.mts +1 -0
  407. package/dist/physics/carnot/preset.d.mts +27 -0
  408. package/dist/physics/carnot/preset.mjs +427 -0
  409. package/dist/physics/circular-motion/index.d.mts +1 -0
  410. package/dist/physics/circular-motion/preset.d.mts +25 -0
  411. package/dist/physics/circular-motion/preset.mjs +293 -0
  412. package/dist/physics/collision-track/index.d.mts +1 -0
  413. package/dist/physics/collision-track/preset.d.mts +27 -0
  414. package/dist/physics/collision-track/preset.mjs +352 -0
  415. package/dist/physics/efficiency/index.d.mts +1 -0
  416. package/dist/physics/efficiency/preset.d.mts +33 -0
  417. package/dist/physics/efficiency/preset.mjs +343 -0
  418. package/dist/physics/electric-field/index.d.mts +1 -0
  419. package/dist/physics/electric-field/preset.d.mts +15 -0
  420. package/dist/physics/electric-field/preset.mjs +306 -0
  421. package/dist/physics/energy-skate/index.d.mts +1 -0
  422. package/dist/physics/energy-skate/preset.d.mts +25 -0
  423. package/dist/physics/energy-skate/preset.mjs +254 -0
  424. package/dist/physics/entropy/index.d.mts +1 -0
  425. package/dist/physics/entropy/preset.d.mts +18 -0
  426. package/dist/physics/entropy/preset.mjs +416 -0
  427. package/dist/physics/expansion/index.d.mts +1 -0
  428. package/dist/physics/expansion/preset.d.mts +26 -0
  429. package/dist/physics/expansion/preset.mjs +609 -0
  430. package/dist/physics/exponential/asset.mjs +221 -0
  431. package/dist/physics/exponential/index.d.mts +1 -0
  432. package/dist/physics/exponential/preset.d.mts +17 -0
  433. package/dist/physics/exponential/preset.mjs +182 -0
  434. package/dist/physics/gas-process/index.d.mts +1 -0
  435. package/dist/physics/gas-process/preset.d.mts +30 -0
  436. package/dist/physics/gas-process/preset.mjs +384 -0
  437. package/dist/physics/gravitation/index.d.mts +1 -0
  438. package/dist/physics/gravitation/preset.d.mts +24 -0
  439. package/dist/physics/gravitation/preset.mjs +345 -0
  440. package/dist/physics/gravity-drop.d.mts +9 -0
  441. package/dist/physics/gravity-drop.mjs +187 -0
  442. package/dist/physics/heat-transfer/index.d.mts +1 -0
  443. package/dist/physics/heat-transfer/preset.d.mts +27 -0
  444. package/dist/physics/heat-transfer/preset.mjs +626 -0
  445. package/dist/physics/impulse/index.d.mts +1 -0
  446. package/dist/physics/impulse/preset.d.mts +29 -0
  447. package/dist/physics/impulse/preset.mjs +453 -0
  448. package/dist/physics/index.d.mts +43 -0
  449. package/dist/physics/index.mjs +44 -0
  450. package/dist/physics/kepler/index.d.mts +1 -0
  451. package/dist/physics/kepler/preset.d.mts +27 -0
  452. package/dist/physics/kepler/preset.mjs +257 -0
  453. package/dist/physics/lever/asset.d.mts +6 -0
  454. package/dist/physics/lever/asset.mjs +220 -0
  455. package/dist/physics/lever/index.d.mts +2 -0
  456. package/dist/physics/lever/preset.d.mts +31 -0
  457. package/dist/physics/lever/preset.mjs +261 -0
  458. package/dist/physics/lorentz/index.d.mts +1 -0
  459. package/dist/physics/lorentz/preset.d.mts +29 -0
  460. package/dist/physics/lorentz/preset.mjs +367 -0
  461. package/dist/physics/magnetism/index.d.mts +1 -0
  462. package/dist/physics/magnetism/preset.d.mts +15 -0
  463. package/dist/physics/magnetism/preset.mjs +334 -0
  464. package/dist/physics/optics/asset.d.mts +6 -0
  465. package/dist/physics/optics/asset.mjs +234 -0
  466. package/dist/physics/optics/index.d.mts +2 -0
  467. package/dist/physics/optics/preset.d.mts +14 -0
  468. package/dist/physics/optics/preset.mjs +202 -0
  469. package/dist/physics/orbit-lab.d.mts +6 -0
  470. package/dist/physics/orbit-lab.mjs +222 -0
  471. package/dist/physics/projectile-lab.d.mts +10 -0
  472. package/dist/physics/projectile-lab.mjs +354 -0
  473. package/dist/physics/rain-relative/index.d.mts +1 -0
  474. package/dist/physics/rain-relative/preset.d.mts +19 -0
  475. package/dist/physics/rain-relative/preset.mjs +358 -0
  476. package/dist/physics/ramp-forces/index.d.mts +1 -0
  477. package/dist/physics/ramp-forces/preset.d.mts +36 -0
  478. package/dist/physics/ramp-forces/preset.mjs +550 -0
  479. package/dist/physics/river-boat.d.mts +22 -0
  480. package/dist/physics/river-boat.mjs +498 -0
  481. package/dist/physics/shm/index.d.mts +1 -0
  482. package/dist/physics/shm/preset.d.mts +33 -0
  483. package/dist/physics/shm/preset.mjs +554 -0
  484. package/dist/physics/stopping-distance/index.d.mts +1 -0
  485. package/dist/physics/stopping-distance/preset.d.mts +29 -0
  486. package/dist/physics/stopping-distance/preset.mjs +662 -0
  487. package/dist/physics/temperature-scales/index.d.mts +1 -0
  488. package/dist/physics/temperature-scales/preset.d.mts +15 -0
  489. package/dist/physics/temperature-scales/preset.mjs +353 -0
  490. package/dist/physics/terminal-velocity/index.d.mts +1 -0
  491. package/dist/physics/terminal-velocity/preset.d.mts +26 -0
  492. package/dist/physics/terminal-velocity/preset.mjs +404 -0
  493. package/dist/physics/thermal/index.d.mts +1 -0
  494. package/dist/physics/thermal/preset.d.mts +44 -0
  495. package/dist/physics/thermal/preset.mjs +373 -0
  496. package/dist/physics/vector-board/index.d.mts +1 -0
  497. package/dist/physics/vector-board/preset.d.mts +65 -0
  498. package/dist/physics/vector-board/preset.mjs +273 -0
  499. package/dist/physics/vector-board/view.d.mts +49 -0
  500. package/dist/physics/vector-board/view.mjs +58 -0
  501. package/dist/physics/vector-scene.d.mts +41 -0
  502. package/dist/physics/vector-scene.mjs +211 -0
  503. package/dist/physics/vector-types/index.d.mts +1 -0
  504. package/dist/physics/vector-types/preset.d.mts +27 -0
  505. package/dist/physics/vector-types/preset.mjs +192 -0
  506. package/dist/physics/water-density/index.d.mts +1 -0
  507. package/dist/physics/water-density/preset.d.mts +18 -0
  508. package/dist/physics/water-density/preset.mjs +439 -0
  509. package/dist/physics/waves/core.mjs +33 -0
  510. package/dist/physics/waves/doppler.d.mts +23 -0
  511. package/dist/physics/waves/doppler.mjs +260 -0
  512. package/dist/physics/waves/index.d.mts +4 -0
  513. package/dist/physics/waves/preset.d.mts +30 -0
  514. package/dist/physics/waves/preset.mjs +488 -0
  515. package/dist/physics/waves/ripple.d.mts +26 -0
  516. package/dist/physics/waves/ripple.mjs +234 -0
  517. package/dist/physics/waves/string.d.mts +29 -0
  518. package/dist/physics/waves/string.mjs +289 -0
  519. package/dist/physics/work-energy/index.d.mts +1 -0
  520. package/dist/physics/work-energy/preset.d.mts +17 -0
  521. package/dist/physics/work-energy/preset.mjs +341 -0
  522. package/dist/schemas/index.d.mts +235 -0
  523. package/dist/schemas/index.mjs +145 -0
  524. package/dist/statistics/center-spread/preset.d.mts +34 -0
  525. package/dist/statistics/center-spread/preset.mjs +323 -0
  526. package/dist/statistics/core/descriptive.d.mts +35 -0
  527. package/dist/statistics/core/descriptive.mjs +64 -0
  528. package/dist/statistics/core/normal.d.mts +21 -0
  529. package/dist/statistics/core/normal.mjs +37 -0
  530. package/dist/statistics/core/sequences.d.mts +27 -0
  531. package/dist/statistics/core/sequences.mjs +35 -0
  532. package/dist/statistics/galton/preset.d.mts +27 -0
  533. package/dist/statistics/galton/preset.mjs +331 -0
  534. package/dist/statistics/histogram/preset.d.mts +27 -0
  535. package/dist/statistics/histogram/preset.mjs +385 -0
  536. package/dist/statistics/index.d.mts +11 -0
  537. package/dist/statistics/index.mjs +12 -0
  538. package/dist/statistics/normal/preset.d.mts +30 -0
  539. package/dist/statistics/normal/preset.mjs +400 -0
  540. package/dist/statistics/sampling/preset.d.mts +32 -0
  541. package/dist/statistics/sampling/preset.mjs +406 -0
  542. package/dist/statistics/sequence/preset.d.mts +28 -0
  543. package/dist/statistics/sequence/preset.mjs +302 -0
  544. package/dist/statistics/z-table/preset.d.mts +28 -0
  545. package/dist/statistics/z-table/preset.mjs +348 -0
  546. package/package.json +266 -0
  547. package/styles.css +267 -0
@@ -0,0 +1,387 @@
1
+ 'use client';
2
+
3
+ import { Tex as Tex$1 } from "../../core/tex.mjs";
4
+ import { Chip, Slider } from "../../kit/controls.mjs";
5
+ import { Callout, ControlBar, Field, LabFrame, LiveRegion } from "../../kit/frame.mjs";
6
+ import { ChallengeCard, useChallenge, useCheckpoint } from "../../kit/pedagogy.mjs";
7
+ import { AngleArc, RightAngleMark } from "../../kit/diagram.mjs";
8
+ import { useState } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ import { Axes, Dot, Grid, Label, Plot, Segment, Stage, Vector } from "@classytic/stage";
11
+
12
+ //#region src/math/harmonic-form/preset.tsx
13
+ /**
14
+ * HarmonicFormLab — "two waves are secretly one": a cos x + b sin x = R cos(x + α).
15
+ *
16
+ * The whole insight is that adding a cosine and a sine of the SAME frequency gives
17
+ * a SINGLE shifted cosine — and you can SEE why with phasors. The cos term is a
18
+ * vector of length a along the axis; the sin term is a vector of length b at a
19
+ * right angle to it (sin lags cos by 90°). Add them tip-to-tail and the resultant
20
+ * has length R = √(a²+b²) at angle α — exactly the amplitude and phase of the one
21
+ * combined wave. Drag a and b: the phasor triangle and the three waves update live,
22
+ * and the messy two-wave sum visibly collapses onto one clean R cos(x + α).
23
+ *
24
+ * This builds the INTUITION for the auxiliary-angle form (Edexcel "express in the
25
+ * form R cos(x+α)"). The exact R and α arithmetic is left to written working / a
26
+ * paired derivation — the lab is the picture, not the algebra.
27
+ *
28
+ * Convention: a cos x + b sin x = R cos(x + α) ⇒ a = R cos α, b = −R sin α, so
29
+ * α = atan2(−b, a) and the resultant phasor is (a, −b). Tokenized SVG; accessible.
30
+ */
31
+ const LIM = 8;
32
+ const PHV = 9;
33
+ const WAV = 12;
34
+ const C_COS = "var(--stage-accent-2)";
35
+ const C_SIN = "var(--stage-warn)";
36
+ const C_R = "var(--stage-good)";
37
+ const HARMONIC_CHALLENGE = [{
38
+ id: "shape",
39
+ prompt: "a cos x + b sin x (same frequency) always combines into…",
40
+ choices: [
41
+ {
42
+ value: "one",
43
+ label: "one shifted cosine wave"
44
+ },
45
+ {
46
+ value: "two",
47
+ label: "two separate waves"
48
+ },
49
+ {
50
+ value: "double",
51
+ label: "a wave of double the frequency"
52
+ }
53
+ ],
54
+ answer: "one",
55
+ explain: "Same frequency in → same frequency out: only the amplitude (R) and the phase (α) change."
56
+ }, {
57
+ id: "amp",
58
+ prompt: "Keep a fixed and increase |b|. The amplitude R of the combined wave…",
59
+ choices: [
60
+ {
61
+ value: "up",
62
+ label: "increases"
63
+ },
64
+ {
65
+ value: "down",
66
+ label: "decreases"
67
+ },
68
+ {
69
+ value: "same",
70
+ label: "stays the same"
71
+ }
72
+ ],
73
+ answer: "up",
74
+ explain: "R = √(a² + b²) is the hypotenuse — growing either coefficient lengthens it."
75
+ }];
76
+ /** LaTeX for "a cos x ± b sin x", tidy for ±1 / 0 coefficients. */
77
+ function lhsTex(a, b) {
78
+ const cosPart = `${a === 1 ? "" : a === -1 ? "-" : a}\\cos x`;
79
+ const bAbs = Math.abs(b);
80
+ const sinPart = `${bAbs === 1 ? "" : bAbs}\\sin x`;
81
+ return `${cosPart} ${b < 0 ? "-" : "+"} ${sinPart}`;
82
+ }
83
+ function HarmonicFormLab({ a: a0 = 4, b: b0 = -3, title = "Express a cos x + b sin x as one wave R cos(x + α)", prompt = "A cosine plus a sine of the same frequency is secretly a single shifted cosine. Drag a and b and watch the phasors add up.", objectives } = {}) {
84
+ const [a, setA] = useState(a0);
85
+ const [b, setB] = useState(b0);
86
+ const [showComp, setShowComp] = useState(true);
87
+ const challenge = useChallenge(HARMONIC_CHALLENGE);
88
+ useCheckpoint({
89
+ solved: challenge.allCorrect,
90
+ activity: "harmonic-form"
91
+ });
92
+ const R = Math.hypot(a, b);
93
+ const alpha = Math.atan2(-b, a);
94
+ const sum = (x) => a * Math.cos(x) + b * Math.sin(x);
95
+ const O = {
96
+ x: 0,
97
+ y: 0
98
+ };
99
+ const corner = {
100
+ x: a,
101
+ y: 0
102
+ };
103
+ const tip = {
104
+ x: a,
105
+ y: -b
106
+ };
107
+ const peakX = -alpha;
108
+ const phasor = /* @__PURE__ */ jsxs(Stage, {
109
+ view: {
110
+ xMin: -9,
111
+ xMax: PHV,
112
+ yMin: -9,
113
+ yMax: PHV
114
+ },
115
+ height: 280,
116
+ ariaLabel: `Phasor diagram: cosine component ${a}, sine component ${b}, resultant length ${R.toFixed(2)}`,
117
+ children: [
118
+ /* @__PURE__ */ jsx(Grid, { step: 3 }),
119
+ /* @__PURE__ */ jsx(Axes, {}),
120
+ showComp && a !== 0 && /* @__PURE__ */ jsx(Vector, {
121
+ tail: O,
122
+ tip: corner,
123
+ color: C_COS,
124
+ weight: 2.5
125
+ }),
126
+ showComp && b !== 0 && /* @__PURE__ */ jsx(Vector, {
127
+ tail: corner,
128
+ tip,
129
+ color: C_SIN,
130
+ weight: 2.5
131
+ }),
132
+ /* @__PURE__ */ jsx(Vector, {
133
+ tail: O,
134
+ tip,
135
+ color: C_R,
136
+ weight: 3.5
137
+ }),
138
+ a !== 0 && b !== 0 && /* @__PURE__ */ jsx(RightAngleMark, {
139
+ at: corner,
140
+ u: {
141
+ x: -1,
142
+ y: 0
143
+ },
144
+ v: {
145
+ x: 0,
146
+ y: -b
147
+ }
148
+ }),
149
+ R > .5 && /* @__PURE__ */ jsx(AngleArc, {
150
+ at: O,
151
+ from: {
152
+ x: 1,
153
+ y: 0
154
+ },
155
+ to: tip,
156
+ rPx: 28,
157
+ label: "α"
158
+ }),
159
+ showComp && a !== 0 && /* @__PURE__ */ jsx(Label, {
160
+ x: a / 2,
161
+ y: 0,
162
+ text: "a",
163
+ color: C_COS,
164
+ size: 13,
165
+ dy: 16
166
+ }),
167
+ showComp && b !== 0 && /* @__PURE__ */ jsx(Label, {
168
+ x: a,
169
+ y: -b / 2,
170
+ text: "b",
171
+ color: C_SIN,
172
+ size: 13,
173
+ dx: 14
174
+ }),
175
+ /* @__PURE__ */ jsx(Label, {
176
+ x: tip.x / 2,
177
+ y: tip.y / 2,
178
+ text: "R",
179
+ color: C_R,
180
+ size: 14,
181
+ dx: -12,
182
+ dy: -6
183
+ })
184
+ ]
185
+ });
186
+ const waves = /* @__PURE__ */ jsxs(Stage, {
187
+ view: {
188
+ xMin: -Math.PI,
189
+ xMax: 2 * Math.PI,
190
+ yMin: -12,
191
+ yMax: WAV
192
+ },
193
+ height: 280,
194
+ preserveAspect: false,
195
+ ariaLabel: "The cosine term, the sine term, and their combined single wave",
196
+ children: [
197
+ /* @__PURE__ */ jsx(Grid, {}),
198
+ /* @__PURE__ */ jsx(Axes, {}),
199
+ /* @__PURE__ */ jsx(Segment, {
200
+ from: {
201
+ x: -Math.PI,
202
+ y: R
203
+ },
204
+ to: {
205
+ x: 2 * Math.PI,
206
+ y: R
207
+ },
208
+ color: C_R,
209
+ weight: 1,
210
+ dashed: true,
211
+ opacity: .4
212
+ }),
213
+ /* @__PURE__ */ jsx(Segment, {
214
+ from: {
215
+ x: -Math.PI,
216
+ y: -R
217
+ },
218
+ to: {
219
+ x: 2 * Math.PI,
220
+ y: -R
221
+ },
222
+ color: C_R,
223
+ weight: 1,
224
+ dashed: true,
225
+ opacity: .4
226
+ }),
227
+ showComp && /* @__PURE__ */ jsx(Plot.OfX, {
228
+ y: (x) => a * Math.cos(x),
229
+ color: C_COS,
230
+ weight: 1.5
231
+ }),
232
+ showComp && /* @__PURE__ */ jsx(Plot.OfX, {
233
+ y: (x) => b * Math.sin(x),
234
+ color: C_SIN,
235
+ weight: 1.5
236
+ }),
237
+ /* @__PURE__ */ jsx(Plot.OfX, {
238
+ y: sum,
239
+ color: C_R,
240
+ weight: 3
241
+ }),
242
+ /* @__PURE__ */ jsx(Segment, {
243
+ from: {
244
+ x: peakX,
245
+ y: 0
246
+ },
247
+ to: {
248
+ x: peakX,
249
+ y: R
250
+ },
251
+ color: "var(--stage-fg)",
252
+ weight: 1,
253
+ dashed: true,
254
+ opacity: .4
255
+ }),
256
+ /* @__PURE__ */ jsx(Dot, {
257
+ x: peakX,
258
+ y: R,
259
+ r: 5,
260
+ color: C_R
261
+ }),
262
+ /* @__PURE__ */ jsx(Label, {
263
+ x: peakX,
264
+ y: R,
265
+ text: "R",
266
+ color: C_R,
267
+ size: 13,
268
+ dy: -10
269
+ }),
270
+ /* @__PURE__ */ jsx(Label, {
271
+ x: peakX,
272
+ y: 0,
273
+ text: "x = −α",
274
+ color: "var(--stage-muted)",
275
+ size: 11,
276
+ dy: 16
277
+ })
278
+ ]
279
+ });
280
+ const figure = /* @__PURE__ */ jsxs("div", {
281
+ style: {
282
+ display: "flex",
283
+ flexWrap: "wrap",
284
+ gap: 12,
285
+ alignItems: "stretch"
286
+ },
287
+ children: [/* @__PURE__ */ jsx("div", {
288
+ style: {
289
+ flex: "1 1 240px",
290
+ minWidth: 240
291
+ },
292
+ children: phasor
293
+ }), /* @__PURE__ */ jsx("div", {
294
+ style: {
295
+ flex: "2 1 320px",
296
+ minWidth: 300
297
+ },
298
+ children: waves
299
+ })]
300
+ });
301
+ return /* @__PURE__ */ jsx(LabFrame, {
302
+ title,
303
+ prompt,
304
+ objectives,
305
+ aside: /* @__PURE__ */ jsx(Callout, {
306
+ tone: "result",
307
+ children: /* @__PURE__ */ jsxs("div", {
308
+ style: {
309
+ display: "grid",
310
+ gap: 8,
311
+ fontVariantNumeric: "tabular-nums"
312
+ },
313
+ children: [
314
+ /* @__PURE__ */ jsx(Tex$1, { tex: lhsTex(a, b) }),
315
+ /* @__PURE__ */ jsx(Tex$1, { tex: `= ${R.toFixed(2)}\\cos(x ${alpha < 0 ? "-" : "+"} ${Math.abs(alpha).toFixed(3)})` }),
316
+ /* @__PURE__ */ jsxs("span", {
317
+ style: { fontSize: 13 },
318
+ children: ["R = √(a² + b²) = ", /* @__PURE__ */ jsx("strong", { children: R.toFixed(3) })]
319
+ }),
320
+ /* @__PURE__ */ jsxs("span", {
321
+ style: { fontSize: 13 },
322
+ children: [
323
+ "α = ",
324
+ /* @__PURE__ */ jsx("strong", { children: alpha.toFixed(3) }),
325
+ " rad = ",
326
+ (alpha * 180 / Math.PI).toFixed(1),
327
+ "°"
328
+ ]
329
+ })
330
+ ]
331
+ })
332
+ }),
333
+ controls: /* @__PURE__ */ jsxs(ControlBar, { children: [
334
+ /* @__PURE__ */ jsx(Field, {
335
+ label: "a (cos x)",
336
+ value: a,
337
+ children: /* @__PURE__ */ jsx(Slider, {
338
+ value: a,
339
+ min: -8,
340
+ max: LIM,
341
+ step: 1,
342
+ onChange: setA,
343
+ ariaLabel: "coefficient of cosine"
344
+ })
345
+ }),
346
+ /* @__PURE__ */ jsx(Field, {
347
+ label: "b (sin x)",
348
+ value: b,
349
+ children: /* @__PURE__ */ jsx(Slider, {
350
+ value: b,
351
+ min: -8,
352
+ max: LIM,
353
+ step: 1,
354
+ onChange: setB,
355
+ ariaLabel: "coefficient of sine"
356
+ })
357
+ }),
358
+ /* @__PURE__ */ jsx(Chip, {
359
+ selected: showComp,
360
+ onClick: () => setShowComp((v) => !v),
361
+ children: "show components"
362
+ })
363
+ ] }),
364
+ footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [
365
+ /* @__PURE__ */ jsxs("p", {
366
+ className: "lab-prompt",
367
+ children: [
368
+ "The two coloured waves add to the bold one. Its height is ",
369
+ /* @__PURE__ */ jsx(Tex$1, { tex: "R=\\sqrt{a^2+b^2}" }),
370
+ " and it peaks at ",
371
+ /* @__PURE__ */ jsx(Tex$1, { tex: "x=-\\alpha" }),
372
+ " — the phasor's length and angle."
373
+ ]
374
+ }),
375
+ /* @__PURE__ */ jsx(ChallengeCard, {
376
+ questions: HARMONIC_CHALLENGE,
377
+ state: challenge,
378
+ title: "Predict"
379
+ }),
380
+ /* @__PURE__ */ jsx(LiveRegion, { children: `${a} cos x ${b < 0 ? "minus" : "plus"} ${Math.abs(b)} sin x equals ${R.toFixed(2)} cos(x ${alpha < 0 ? "minus" : "plus"} ${Math.abs(alpha).toFixed(3)}).` })
381
+ ] }),
382
+ children: figure
383
+ });
384
+ }
385
+
386
+ //#endregion
387
+ export { HarmonicFormLab };
@@ -0,0 +1,25 @@
1
+ import { GraphEquation, GraphParam, Grapher, GrapherProps } from "./grapher/preset.mjs";
2
+ import { DerivativeExplorer, DerivativeExplorerProps } from "./derivative-explorer/preset.mjs";
3
+ import { IntegralExplorer, IntegralExplorerProps } from "./integral-explorer/preset.mjs";
4
+ import { LimitExplorer, LimitExplorerProps } from "./limit-explorer/preset.mjs";
5
+ import { LinearSystemLab, LinearSystemProps, SystemLine } from "./linear-system/preset.mjs";
6
+ import { NumberLineLab, NumberLineProps } from "./number-line/preset.mjs";
7
+ import { AREA_MODEL_ASSET } from "./area-model/asset.mjs";
8
+ import { AreaModelLab, AreaModelProps, areaModelDoc } from "./area-model/preset.mjs";
9
+ import { PATTERN_FIGURE_ASSET } from "./pattern/asset.mjs";
10
+ import { GrowingPatternLab, GrowingPatternProps, growingPatternDoc } from "./pattern/preset.mjs";
11
+ import { MYSTERY_BUCKET_ASSET } from "./mystery-bucket/asset.mjs";
12
+ import { MysteryBucketLab, MysteryBucketProps, mysteryBucketDoc } from "./mystery-bucket/preset.mjs";
13
+ import { BALANCE_ALGEBRA_ASSET } from "./balance-algebra/asset.mjs";
14
+ import { BalanceAlgebraLab, BalanceAlgebraProps, BalanceEquation, balanceAlgebraDoc } from "./balance-algebra/preset.mjs";
15
+ import { ParabolaProps, VertexParabolaLab } from "./parabola/preset.mjs";
16
+ import { HarmonicFormLab, HarmonicFormProps } from "./harmonic-form/preset.mjs";
17
+ import { FunctionMachineLab, FunctionMachineProps } from "./function-machine/preset.mjs";
18
+ import { TRIG_FNS, TrigExplorer, TrigFn } from "./trig-explorer.mjs";
19
+ import { Derivation, DerivationProps, DerivationStep } from "./derivation.mjs";
20
+ import { GradientDescent, GradientDescentProps } from "./gradient-descent.mjs";
21
+ import { AnswerSpec, ExprCheckOpts, checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
22
+ import { Derived, InteractiveProblem, InteractiveProblemProps, ProblemAsk, ProblemEquation, ProblemParam } from "./interactive/preset.mjs";
23
+ import { TriangleTrig, TriangleTrigProps } from "./triangle-trig/preset.mjs";
24
+ import { Fn1, Line, areaBetween, integrate, intersections, normalAt, roots, tangentAt } from "../kit/expr-analysis.mjs";
25
+ export { AREA_MODEL_ASSET, type AnswerSpec, AreaModelLab, type AreaModelProps, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, type BalanceAlgebraProps, type BalanceEquation, Derivation, type DerivationProps, type DerivationStep, DerivativeExplorer, type DerivativeExplorerProps, type Derived, type ExprCheckOpts, type Fn1, FunctionMachineLab, type FunctionMachineProps, GradientDescent, type GradientDescentProps, type GraphEquation, type GraphParam, Grapher, type GrapherProps, GrowingPatternLab, type GrowingPatternProps, HarmonicFormLab, type HarmonicFormProps, IntegralExplorer, type IntegralExplorerProps, InteractiveProblem, type InteractiveProblemProps, LimitExplorer, type LimitExplorerProps, type Line, LinearSystemLab, type LinearSystemProps, MYSTERY_BUCKET_ASSET, MysteryBucketLab, type MysteryBucketProps, NumberLineLab, type NumberLineProps, PATTERN_FIGURE_ASSET, type ParabolaProps, type ProblemAsk, type ProblemEquation, type ProblemParam, type SystemLine, TRIG_FNS, TriangleTrig, type TriangleTrigProps, TrigExplorer, type TrigFn, VertexParabolaLab, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, growingPatternDoc, integrate, intersections, mysteryBucketDoc, normalAt, parseValue, roots, tangentAt };
@@ -0,0 +1,26 @@
1
+ import { Grapher } from "./grapher/preset.mjs";
2
+ import { DerivativeExplorer } from "./derivative-explorer/preset.mjs";
3
+ import { IntegralExplorer } from "./integral-explorer/preset.mjs";
4
+ import { LimitExplorer } from "./limit-explorer/preset.mjs";
5
+ import { LinearSystemLab } from "./linear-system/preset.mjs";
6
+ import { NumberLineLab } from "./number-line/preset.mjs";
7
+ import { AREA_MODEL_ASSET } from "./area-model/asset.mjs";
8
+ import { AreaModelLab, areaModelDoc } from "./area-model/preset.mjs";
9
+ import { PATTERN_FIGURE_ASSET } from "./pattern/asset.mjs";
10
+ import { GrowingPatternLab, growingPatternDoc } from "./pattern/preset.mjs";
11
+ import { MYSTERY_BUCKET_ASSET } from "./mystery-bucket/asset.mjs";
12
+ import { MysteryBucketLab, mysteryBucketDoc } from "./mystery-bucket/preset.mjs";
13
+ import { BALANCE_ALGEBRA_ASSET } from "./balance-algebra/asset.mjs";
14
+ import { BalanceAlgebraLab, balanceAlgebraDoc } from "./balance-algebra/preset.mjs";
15
+ import { VertexParabolaLab } from "./parabola/preset.mjs";
16
+ import { HarmonicFormLab } from "./harmonic-form/preset.mjs";
17
+ import { FunctionMachineLab } from "./function-machine/preset.mjs";
18
+ import { TRIG_FNS, TrigExplorer } from "./trig-explorer.mjs";
19
+ import { Derivation } from "./derivation.mjs";
20
+ import { GradientDescent } from "./gradient-descent.mjs";
21
+ import { areaBetween, integrate, intersections, normalAt, roots, tangentAt } from "../kit/expr-analysis.mjs";
22
+ import { checkAnswer, checkExpression, checkNumber, parseValue } from "../kit/answer-check.mjs";
23
+ import { InteractiveProblem } from "./interactive/preset.mjs";
24
+ import { TriangleTrig } from "./triangle-trig/preset.mjs";
25
+
26
+ export { AREA_MODEL_ASSET, AreaModelLab, BALANCE_ALGEBRA_ASSET, BalanceAlgebraLab, Derivation, DerivativeExplorer, FunctionMachineLab, GradientDescent, Grapher, GrowingPatternLab, HarmonicFormLab, IntegralExplorer, InteractiveProblem, LimitExplorer, LinearSystemLab, MYSTERY_BUCKET_ASSET, MysteryBucketLab, NumberLineLab, PATTERN_FIGURE_ASSET, TRIG_FNS, TriangleTrig, TrigExplorer, VertexParabolaLab, areaBetween, areaModelDoc, balanceAlgebraDoc, checkAnswer, checkExpression, checkNumber, growingPatternDoc, integrate, intersections, mysteryBucketDoc, normalAt, parseValue, roots, tangentAt };
@@ -0,0 +1 @@
1
+ import { IntegralExplorer, IntegralExplorerProps } from "./preset.mjs";
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from "react";
2
+
3
+ //#region src/math/integral-explorer/preset.d.ts
4
+ interface IntegralExplorerProps {
5
+ equation?: string;
6
+ xRange?: [number, number];
7
+ a?: number;
8
+ b?: number;
9
+ n?: number;
10
+ title?: string;
11
+ height?: number;
12
+ }
13
+ declare function IntegralExplorer({
14
+ equation,
15
+ xRange,
16
+ a: aInit,
17
+ b: bInit,
18
+ n: nInit,
19
+ title,
20
+ height
21
+ }?: IntegralExplorerProps): ReactNode;
22
+ //#endregion
23
+ export { IntegralExplorer, IntegralExplorerProps };
@@ -0,0 +1,217 @@
1
+ 'use client';
2
+
3
+ import { clamp } from "../../core/util.mjs";
4
+ import { integrate, riemannSum } from "../../core/numeric.mjs";
5
+ import { Tex as Tex$1 } from "../../core/tex.mjs";
6
+ import { LabStyles, Slider } from "../../kit/controls.mjs";
7
+ import { ControlBar, Field, LabFrame } from "../../kit/frame.mjs";
8
+ import { useEffect, useMemo, useState } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ import { Axes, Grid, MovableDot, Plot, Polygon, Stage, compileExpr, evaluate, toLatex } from "@classytic/stage";
11
+
12
+ //#region src/math/integral-explorer/preset.tsx
13
+ /**
14
+ * IntegralExplorer — the integral as "area under the curve," on @classytic/stage.
15
+ * Shades f(x) over [a,b] with n Riemann rectangles (SVG Polygons); drag the
16
+ * endpoints, crank n, switch left/mid/right, and watch the estimate converge to
17
+ * the Simpson reference. Reuses the pure `riemannSum`/`integrate` helpers.
18
+ */
19
+ const MODES = [
20
+ "left",
21
+ "mid",
22
+ "right"
23
+ ];
24
+ function IntegralExplorer({ equation = "0.4*x^2 + 0.5", xRange = [-1, 4], a: aInit = 0, b: bInit = 3, n: nInit = 8, title = "The integral is an area", height = 340 } = {}) {
25
+ const [xMin, xMax] = xRange;
26
+ const [a, setA] = useState(clamp(aInit, xMin, xMax));
27
+ const [b, setB] = useState(clamp(bInit, xMin, xMax));
28
+ const [n, setN] = useState(nInit);
29
+ const [mode, setMode] = useState("mid");
30
+ useEffect(() => {
31
+ setA(clamp(aInit, xMin, xMax));
32
+ }, [
33
+ aInit,
34
+ xMin,
35
+ xMax
36
+ ]);
37
+ useEffect(() => {
38
+ setB(clamp(bInit, xMin, xMax));
39
+ }, [
40
+ bInit,
41
+ xMin,
42
+ xMax
43
+ ]);
44
+ useEffect(() => {
45
+ setN(nInit);
46
+ }, [nInit]);
47
+ const model = useMemo(() => {
48
+ const res = compileExpr(equation);
49
+ if (!res.ast) return {
50
+ ok: false,
51
+ error: res.error ?? "Invalid expression"
52
+ };
53
+ const ast = res.ast;
54
+ return {
55
+ ok: true,
56
+ f: (x) => evaluate(ast, { x }),
57
+ fLatex: toLatex(ast)
58
+ };
59
+ }, [equation]);
60
+ if (!model.ok) return /* @__PURE__ */ jsxs("div", {
61
+ className: "not-prose",
62
+ children: [/* @__PURE__ */ jsx("p", {
63
+ style: { fontWeight: 600 },
64
+ children: title
65
+ }), /* @__PURE__ */ jsxs("div", {
66
+ style: {
67
+ padding: 12,
68
+ fontSize: 13,
69
+ color: "var(--stage-danger)"
70
+ },
71
+ children: [
72
+ "“",
73
+ equation,
74
+ "” — ",
75
+ model.error
76
+ ]
77
+ })]
78
+ });
79
+ const { f, fLatex } = model;
80
+ const ys = [];
81
+ for (let i = 0; i <= 200; i++) {
82
+ const y = f(xMin + (xMax - xMin) * i / 200);
83
+ if (Number.isFinite(y)) ys.push(y);
84
+ }
85
+ ys.sort((p, q) => p - q);
86
+ let yMin = Math.min(ys[Math.floor(ys.length * .02)] ?? -1, 0);
87
+ let yMax = Math.max(ys[Math.floor(ys.length * .98)] ?? 1, 0);
88
+ if (yMin === yMax) {
89
+ yMin -= 1;
90
+ yMax += 1;
91
+ }
92
+ const pad = (yMax - yMin) * .12;
93
+ [yMin, yMax] = [yMin - pad, yMax + pad];
94
+ const lo = Math.min(a, b), hi = Math.max(a, b);
95
+ const dx = n > 0 ? (hi - lo) / n : 0;
96
+ const rects = [];
97
+ for (let i = 0; i < n; i++) {
98
+ const xl = lo + i * dx;
99
+ const fy = f(mode === "left" ? xl : mode === "right" ? xl + dx : xl + dx / 2);
100
+ if (!Number.isFinite(fy)) continue;
101
+ rects.push({
102
+ pts: [
103
+ {
104
+ x: xl,
105
+ y: 0
106
+ },
107
+ {
108
+ x: xl + dx,
109
+ y: 0
110
+ },
111
+ {
112
+ x: xl + dx,
113
+ y: fy
114
+ },
115
+ {
116
+ x: xl,
117
+ y: fy
118
+ }
119
+ ],
120
+ pos: fy >= 0
121
+ });
122
+ }
123
+ const approx = riemannSum(f, [lo, hi], n, mode);
124
+ const reference = integrate(f, [lo, hi], 1e3);
125
+ const figure = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(LabStyles, {}), /* @__PURE__ */ jsxs(Stage, {
126
+ view: {
127
+ xMin,
128
+ xMax,
129
+ yMin,
130
+ yMax
131
+ },
132
+ height,
133
+ ariaLabel: `Riemann sum of ${equation} over [${lo.toFixed(1)}, ${hi.toFixed(1)}]`,
134
+ children: [
135
+ /* @__PURE__ */ jsx(Grid, {}),
136
+ rects.map((r, i) => /* @__PURE__ */ jsx(Polygon, {
137
+ points: r.pts,
138
+ color: r.pos ? "var(--stage-accent)" : "var(--stage-danger)",
139
+ fill: r.pos ? "var(--stage-accent)" : "var(--stage-danger)",
140
+ fillOpacity: .26,
141
+ weight: 1
142
+ }, i)),
143
+ /* @__PURE__ */ jsx(Axes, {}),
144
+ /* @__PURE__ */ jsx(Plot.OfX, {
145
+ y: f,
146
+ domain: [xMin, xMax],
147
+ color: "var(--stage-fg)",
148
+ weight: 2.5
149
+ }),
150
+ /* @__PURE__ */ jsx(MovableDot, {
151
+ value: {
152
+ x: a,
153
+ y: 0
154
+ },
155
+ onMove: (p) => setA(clamp(p.x, xMin, xMax)),
156
+ constrain: "horizontal",
157
+ color: "var(--stage-good)",
158
+ ariaLabel: "left endpoint a"
159
+ }),
160
+ /* @__PURE__ */ jsx(MovableDot, {
161
+ value: {
162
+ x: b,
163
+ y: 0
164
+ },
165
+ onMove: (p) => setB(clamp(p.x, xMin, xMax)),
166
+ constrain: "horizontal",
167
+ color: "var(--stage-good)",
168
+ ariaLabel: "right endpoint b"
169
+ })
170
+ ]
171
+ })] });
172
+ return /* @__PURE__ */ jsx(LabFrame, {
173
+ title,
174
+ controls: /* @__PURE__ */ jsxs(ControlBar, { children: [
175
+ /* @__PURE__ */ jsx(Field, {
176
+ label: "rectangles n",
177
+ value: /* @__PURE__ */ jsx("strong", { children: n }),
178
+ children: /* @__PURE__ */ jsx(Slider, {
179
+ value: n,
180
+ min: 1,
181
+ max: 80,
182
+ step: 1,
183
+ onChange: (v) => setN(Math.round(v)),
184
+ ariaLabel: "number of rectangles"
185
+ })
186
+ }),
187
+ /* @__PURE__ */ jsxs("button", {
188
+ type: "button",
189
+ className: "lab-chip",
190
+ onClick: () => setMode((mm) => MODES[(MODES.indexOf(mm) + 1) % 3]),
191
+ children: [mode, " sum"]
192
+ }),
193
+ /* @__PURE__ */ jsxs("span", {
194
+ style: { opacity: .8 },
195
+ children: ["sum ", /* @__PURE__ */ jsx("strong", { children: approx.toFixed(3) })]
196
+ }),
197
+ /* @__PURE__ */ jsx("span", {
198
+ style: {
199
+ color: "var(--stage-good)",
200
+ fontWeight: 600
201
+ },
202
+ children: /* @__PURE__ */ jsx(Tex$1, { tex: `\\int \\approx ${reference.toFixed(3)}` })
203
+ })
204
+ ] }),
205
+ footer: /* @__PURE__ */ jsx("div", {
206
+ style: {
207
+ padding: "8px 2px 0",
208
+ fontSize: 14
209
+ },
210
+ children: /* @__PURE__ */ jsx(Tex$1, { tex: `\\int_{${lo.toFixed(1)}}^{${hi.toFixed(1)}}\\left(${fLatex}\\right)\\,dx \\approx ${approx.toFixed(3)}` })
211
+ }),
212
+ children: figure
213
+ });
214
+ }
215
+
216
+ //#endregion
217
+ export { IntegralExplorer };
@@ -0,0 +1 @@
1
+ import { Derived, InteractiveProblem, InteractiveProblemProps, ProblemAsk, ProblemEquation, ProblemParam } from "./preset.mjs";