@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.
- package/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/biology/enzyme-rate/index.d.mts +1 -0
- package/dist/biology/enzyme-rate/preset.d.mts +25 -0
- package/dist/biology/enzyme-rate/preset.mjs +256 -0
- package/dist/biology/genetic-cross/core.d.mts +64 -0
- package/dist/biology/genetic-cross/core.mjs +147 -0
- package/dist/biology/genetic-cross/grid.mjs +239 -0
- package/dist/biology/genetic-cross/index.d.mts +3 -0
- package/dist/biology/genetic-cross/preset.d.mts +26 -0
- package/dist/biology/genetic-cross/preset.mjs +184 -0
- package/dist/biology/genetic-cross/sex-linked.d.mts +27 -0
- package/dist/biology/genetic-cross/sex-linked.mjs +226 -0
- package/dist/biology/index.d.mts +11 -0
- package/dist/biology/index.mjs +12 -0
- package/dist/biology/photosynthesis-factors/index.d.mts +1 -0
- package/dist/biology/photosynthesis-factors/preset.d.mts +25 -0
- package/dist/biology/photosynthesis-factors/preset.mjs +270 -0
- package/dist/biology/punnett-cross/index.d.mts +1 -0
- package/dist/biology/punnett-cross/preset.d.mts +27 -0
- package/dist/biology/punnett-cross/preset.mjs +21 -0
- package/dist/biology/respiration/index.d.mts +1 -0
- package/dist/biology/respiration/preset.d.mts +17 -0
- package/dist/biology/respiration/preset.mjs +179 -0
- package/dist/biology/sequence/central-dogma.d.mts +17 -0
- package/dist/biology/sequence/central-dogma.mjs +339 -0
- package/dist/biology/sequence/core.d.mts +38 -0
- package/dist/biology/sequence/core.mjs +178 -0
- package/dist/biology/sequence/index.d.mts +3 -0
- package/dist/biology/sequence/preset.d.mts +20 -0
- package/dist/biology/sequence/preset.mjs +235 -0
- package/dist/blocks/accounting.d.mts +142 -0
- package/dist/blocks/accounting.mjs +446 -0
- package/dist/blocks/authoring.d.mts +12 -0
- package/dist/blocks/authoring.mjs +705 -0
- package/dist/blocks/biology.d.mts +197 -0
- package/dist/blocks/biology.mjs +513 -0
- package/dist/blocks/chem.d.mts +128 -0
- package/dist/blocks/chem.mjs +486 -0
- package/dist/blocks/circuits.d.mts +86 -0
- package/dist/blocks/circuits.mjs +348 -0
- package/dist/blocks/discrete.d.mts +62 -0
- package/dist/blocks/discrete.mjs +314 -0
- package/dist/blocks/economics.d.mts +56 -0
- package/dist/blocks/economics.mjs +203 -0
- package/dist/blocks/geography.d.mts +58 -0
- package/dist/blocks/geography.mjs +115 -0
- package/dist/blocks/geometry.d.mts +28 -0
- package/dist/blocks/geometry.mjs +160 -0
- package/dist/blocks/ict.d.mts +65 -0
- package/dist/blocks/ict.mjs +197 -0
- package/dist/blocks/index.d.mts +4555 -0
- package/dist/blocks/index.mjs +120 -0
- package/dist/blocks/lab-block.d.mts +16 -0
- package/dist/blocks/lab-block.mjs +74 -0
- package/dist/blocks/lab-config.d.mts +23 -0
- package/dist/blocks/lab-config.mjs +200 -0
- package/dist/blocks/lab-gallery.d.mts +30 -0
- package/dist/blocks/lab-gallery.mjs +208 -0
- package/dist/blocks/language.d.mts +349 -0
- package/dist/blocks/language.mjs +750 -0
- package/dist/blocks/lesson.d.mts +43 -0
- package/dist/blocks/lesson.mjs +140 -0
- package/dist/blocks/math.d.mts +411 -0
- package/dist/blocks/math.mjs +1536 -0
- package/dist/blocks/ml.d.mts +84 -0
- package/dist/blocks/ml.mjs +146 -0
- package/dist/blocks/physics.d.mts +259 -0
- package/dist/blocks/physics.mjs +868 -0
- package/dist/blocks/statistics.d.mts +29 -0
- package/dist/blocks/statistics.mjs +123 -0
- package/dist/catalog/index.d.mts +3 -0
- package/dist/catalog/index.mjs +8 -0
- package/dist/catalog/registry.d.mts +46 -0
- package/dist/catalog/registry.mjs +56 -0
- package/dist/catalog/templates.d.mts +11 -0
- package/dist/catalog/templates.mjs +141 -0
- package/dist/chem/battery.d.mts +16 -0
- package/dist/chem/battery.mjs +311 -0
- package/dist/chem/bohr-atom.d.mts +16 -0
- package/dist/chem/bohr-atom.mjs +212 -0
- package/dist/chem/diffusion/asset.mjs +76 -0
- package/dist/chem/diffusion/index.d.mts +1 -0
- package/dist/chem/diffusion/preset.d.mts +15 -0
- package/dist/chem/diffusion/preset.mjs +188 -0
- package/dist/chem/electrochem/index.d.mts +1 -0
- package/dist/chem/electrochem/preset.d.mts +23 -0
- package/dist/chem/electrochem/preset.mjs +402 -0
- package/dist/chem/equilibrium/index.d.mts +1 -0
- package/dist/chem/equilibrium/preset.d.mts +36 -0
- package/dist/chem/equilibrium/preset.mjs +416 -0
- package/dist/chem/gas-box/index.d.mts +1 -0
- package/dist/chem/gas-box/preset.d.mts +27 -0
- package/dist/chem/gas-box/preset.mjs +395 -0
- package/dist/chem/index.d.mts +16 -0
- package/dist/chem/index.mjs +17 -0
- package/dist/chem/kinetics/index.d.mts +1 -0
- package/dist/chem/kinetics/preset.d.mts +31 -0
- package/dist/chem/kinetics/preset.mjs +478 -0
- package/dist/chem/periodic-trends/index.d.mts +1 -0
- package/dist/chem/periodic-trends/preset.d.mts +21 -0
- package/dist/chem/periodic-trends/preset.mjs +831 -0
- package/dist/chem/reaction-lab.d.mts +18 -0
- package/dist/chem/reaction-lab.mjs +165 -0
- package/dist/chem/reaction-profile.d.mts +21 -0
- package/dist/chem/reaction-profile.mjs +287 -0
- package/dist/chem/solution/dilution.d.mts +27 -0
- package/dist/chem/solution/dilution.mjs +199 -0
- package/dist/chem/solution/field.d.mts +30 -0
- package/dist/chem/solution/field.mjs +145 -0
- package/dist/chem/solution/index.d.mts +3 -0
- package/dist/chem/solution/solution-box.d.mts +28 -0
- package/dist/chem/solution/solution-box.mjs +140 -0
- package/dist/chem/stoichiometry/index.d.mts +1 -0
- package/dist/chem/stoichiometry/preset.d.mts +29 -0
- package/dist/chem/stoichiometry/preset.mjs +392 -0
- package/dist/chem/titration/index.d.mts +1 -0
- package/dist/chem/titration/preset.d.mts +29 -0
- package/dist/chem/titration/preset.mjs +436 -0
- package/dist/circuits/ac-dc/asset.mjs +295 -0
- package/dist/circuits/ac-dc/index.d.mts +1 -0
- package/dist/circuits/ac-dc/preset.d.mts +16 -0
- package/dist/circuits/ac-dc/preset.mjs +134 -0
- package/dist/circuits/capacitor-leak/index.d.mts +1 -0
- package/dist/circuits/capacitor-leak/preset.d.mts +32 -0
- package/dist/circuits/capacitor-leak/preset.mjs +271 -0
- package/dist/circuits/circuit/asset.d.mts +6 -0
- package/dist/circuits/circuit/asset.mjs +367 -0
- package/dist/circuits/circuit/index.d.mts +2 -0
- package/dist/circuits/circuit/preset.d.mts +46 -0
- package/dist/circuits/circuit/preset.mjs +235 -0
- package/dist/circuits/circuit-builder.d.mts +30 -0
- package/dist/circuits/circuit-builder.mjs +412 -0
- package/dist/circuits/circuit-lab.d.mts +20 -0
- package/dist/circuits/circuit-lab.mjs +400 -0
- package/dist/circuits/index.d.mts +7 -0
- package/dist/circuits/index.mjs +8 -0
- package/dist/commerce/accounting/core.d.mts +48 -0
- package/dist/commerce/accounting/core.mjs +57 -0
- package/dist/commerce/accounting/equation-balance.d.mts +35 -0
- package/dist/commerce/accounting/equation-balance.mjs +292 -0
- package/dist/commerce/accounting/index.d.mts +4 -0
- package/dist/commerce/accounting/journal-poster.d.mts +29 -0
- package/dist/commerce/accounting/journal-poster.mjs +472 -0
- package/dist/commerce/accounting/statement-sorter.d.mts +25 -0
- package/dist/commerce/accounting/statement-sorter.mjs +304 -0
- package/dist/commerce/economics/core.d.mts +33 -0
- package/dist/commerce/economics/core.mjs +26 -0
- package/dist/commerce/economics/demand-shift-vs-move.d.mts +35 -0
- package/dist/commerce/economics/demand-shift-vs-move.mjs +324 -0
- package/dist/commerce/economics/elasticity-revenue.d.mts +31 -0
- package/dist/commerce/economics/elasticity-revenue.mjs +253 -0
- package/dist/commerce/economics/index.d.mts +4 -0
- package/dist/commerce/economics/market-equilibrium.d.mts +33 -0
- package/dist/commerce/economics/market-equilibrium.mjs +340 -0
- package/dist/commerce/index.d.mts +9 -0
- package/dist/commerce/index.mjs +10 -0
- package/dist/core/easing.d.mts +28 -0
- package/dist/core/easing.mjs +66 -0
- package/dist/core/index.d.mts +10 -0
- package/dist/core/index.mjs +11 -0
- package/dist/core/numeric.d.mts +37 -0
- package/dist/core/numeric.mjs +75 -0
- package/dist/core/reactive.d.mts +24 -0
- package/dist/core/reactive.mjs +51 -0
- package/dist/core/rng.d.mts +21 -0
- package/dist/core/rng.mjs +39 -0
- package/dist/core/tex.d.mts +14 -0
- package/dist/core/tex.mjs +44 -0
- package/dist/core/timeline.d.mts +34 -0
- package/dist/core/timeline.mjs +77 -0
- package/dist/core/util.d.mts +19 -0
- package/dist/core/util.mjs +31 -0
- package/dist/discrete/arrangements/preset.d.mts +28 -0
- package/dist/discrete/arrangements/preset.mjs +304 -0
- package/dist/discrete/bayes/preset.d.mts +33 -0
- package/dist/discrete/bayes/preset.mjs +476 -0
- package/dist/discrete/binomial/preset.d.mts +25 -0
- package/dist/discrete/binomial/preset.mjs +333 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -0
- package/dist/discrete/core/combinatorics.mjs +57 -0
- package/dist/discrete/core/inclusionExclusion.d.mts +19 -0
- package/dist/discrete/core/inclusionExclusion.mjs +30 -0
- package/dist/discrete/core/pigeonhole.d.mts +15 -0
- package/dist/discrete/core/pigeonhole.mjs +24 -0
- package/dist/discrete/core/probability.d.mts +29 -0
- package/dist/discrete/core/probability.mjs +43 -0
- package/dist/discrete/core/sets.d.mts +21 -0
- package/dist/discrete/core/sets.mjs +45 -0
- package/dist/discrete/counting-slots/preset.d.mts +30 -0
- package/dist/discrete/counting-slots/preset.mjs +553 -0
- package/dist/discrete/counting-tree/index.d.mts +1 -0
- package/dist/discrete/counting-tree/preset.d.mts +44 -0
- package/dist/discrete/counting-tree/preset.mjs +364 -0
- package/dist/discrete/expected-value/preset.d.mts +28 -0
- package/dist/discrete/expected-value/preset.mjs +352 -0
- package/dist/discrete/hypergeometric/preset.d.mts +25 -0
- package/dist/discrete/hypergeometric/preset.mjs +330 -0
- package/dist/discrete/index.d.mts +26 -0
- package/dist/discrete/index.mjs +27 -0
- package/dist/discrete/karnaugh/index.d.mts +1 -0
- package/dist/discrete/karnaugh/preset.d.mts +30 -0
- package/dist/discrete/karnaugh/preset.mjs +452 -0
- package/dist/discrete/lln/asset.mjs +206 -0
- package/dist/discrete/lln/index.d.mts +1 -0
- package/dist/discrete/lln/preset.d.mts +17 -0
- package/dist/discrete/lln/preset.mjs +152 -0
- package/dist/discrete/logic-circuit/index.d.mts +1 -0
- package/dist/discrete/logic-circuit/preset.d.mts +47 -0
- package/dist/discrete/logic-circuit/preset.mjs +307 -0
- package/dist/discrete/monte-carlo/index.d.mts +1 -0
- package/dist/discrete/monte-carlo/preset.d.mts +64 -0
- package/dist/discrete/monte-carlo/preset.mjs +446 -0
- package/dist/discrete/monty-hall/index.d.mts +1 -0
- package/dist/discrete/monty-hall/preset.d.mts +23 -0
- package/dist/discrete/monty-hall/preset.mjs +491 -0
- package/dist/discrete/outcome-builder/preset.d.mts +24 -0
- package/dist/discrete/outcome-builder/preset.mjs +283 -0
- package/dist/discrete/pascal/preset.d.mts +24 -0
- package/dist/discrete/pascal/preset.mjs +372 -0
- package/dist/discrete/sample-space/index.d.mts +1 -0
- package/dist/discrete/sample-space/preset.d.mts +42 -0
- package/dist/discrete/sample-space/preset.mjs +395 -0
- package/dist/discrete/selection/preset.d.mts +33 -0
- package/dist/discrete/selection/preset.mjs +406 -0
- package/dist/discrete/truth-table/index.d.mts +1 -0
- package/dist/discrete/truth-table/preset.d.mts +30 -0
- package/dist/discrete/truth-table/preset.mjs +456 -0
- package/dist/discrete/venn/index.d.mts +1 -0
- package/dist/discrete/venn/preset.d.mts +32 -0
- package/dist/discrete/venn/preset.mjs +461 -0
- package/dist/geography/cycle-lab/index.d.mts +1 -0
- package/dist/geography/cycle-lab/preset.d.mts +25 -0
- package/dist/geography/cycle-lab/preset.mjs +254 -0
- package/dist/geography/cycles.d.mts +21 -0
- package/dist/geography/cycles.mjs +205 -0
- package/dist/geography/index.d.mts +4 -0
- package/dist/geography/index.mjs +5 -0
- package/dist/geometry/board/index.d.mts +1 -0
- package/dist/geometry/board/preset.d.mts +71 -0
- package/dist/geometry/board/preset.mjs +148 -0
- package/dist/geometry/builder.d.mts +18 -0
- package/dist/geometry/builder.mjs +332 -0
- package/dist/geometry/index.d.mts +4 -0
- package/dist/geometry/index.mjs +5 -0
- package/dist/geometry/intersecting-circles.d.mts +17 -0
- package/dist/geometry/intersecting-circles.mjs +104 -0
- package/dist/ict/index.d.mts +5 -0
- package/dist/ict/index.mjs +6 -0
- package/dist/ict/number-systems/base-odometer.d.mts +34 -0
- package/dist/ict/number-systems/base-odometer.mjs +160 -0
- package/dist/ict/number-systems/bit-grouper.d.mts +32 -0
- package/dist/ict/number-systems/bit-grouper.mjs +190 -0
- package/dist/ict/number-systems/index.d.mts +4 -0
- package/dist/ict/number-systems/place-value-dial.d.mts +29 -0
- package/dist/ict/number-systems/place-value-dial.mjs +153 -0
- package/dist/ict/number-systems/wheel.d.mts +73 -0
- package/dist/ict/number-systems/wheel.mjs +279 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +11 -0
- package/dist/kit/anim.mjs +52 -0
- package/dist/kit/annotate.mjs +116 -0
- package/dist/kit/answer-check.d.mts +38 -0
- package/dist/kit/answer-check.mjs +65 -0
- package/dist/kit/asset-util.mjs +15 -0
- package/dist/kit/controls.mjs +77 -0
- package/dist/kit/cycle.d.mts +44 -0
- package/dist/kit/cycle.mjs +188 -0
- package/dist/kit/diagram.mjs +176 -0
- package/dist/kit/electronics.mjs +357 -0
- package/dist/kit/expr-analysis.d.mts +37 -0
- package/dist/kit/expr-analysis.mjs +111 -0
- package/dist/kit/frame.d.mts +70 -0
- package/dist/kit/frame.mjs +205 -0
- package/dist/kit/freq-tree.mjs +99 -0
- package/dist/kit/gameshow.mjs +315 -0
- package/dist/kit/index.d.mts +5 -0
- package/dist/kit/index.mjs +6 -0
- package/dist/kit/logic-gates.d.mts +6 -0
- package/dist/kit/logic-gates.mjs +210 -0
- package/dist/kit/molecules.mjs +178 -0
- package/dist/kit/pedagogy.d.mts +126 -0
- package/dist/kit/pedagogy.mjs +331 -0
- package/dist/kit/play.d.mts +21 -0
- package/dist/kit/play.mjs +52 -0
- package/dist/kit/probability.mjs +141 -0
- package/dist/kit/proportion.mjs +112 -0
- package/dist/kit/reaction.mjs +102 -0
- package/dist/kit/rich.d.mts +10 -0
- package/dist/kit/rich.mjs +21 -0
- package/dist/kit/scale.mjs +230 -0
- package/dist/kit/space.mjs +326 -0
- package/dist/kit/steps.d.mts +24 -0
- package/dist/kit/steps.mjs +57 -0
- package/dist/kit/thermal.mjs +289 -0
- package/dist/language/agreement/index.d.mts +1 -0
- package/dist/language/agreement/preset.d.mts +27 -0
- package/dist/language/agreement/preset.mjs +113 -0
- package/dist/language/article-lens/index.d.mts +1 -0
- package/dist/language/article-lens/preset.d.mts +31 -0
- package/dist/language/article-lens/preset.mjs +125 -0
- package/dist/language/deck.d.mts +45 -0
- package/dist/language/deck.mjs +61 -0
- package/dist/language/icon.d.mts +40 -0
- package/dist/language/icon.mjs +73 -0
- package/dist/language/index.d.mts +10 -0
- package/dist/language/index.mjs +11 -0
- package/dist/language/preposition-scene/index.d.mts +1 -0
- package/dist/language/preposition-scene/preset.d.mts +34 -0
- package/dist/language/preposition-scene/preset.mjs +234 -0
- package/dist/language/sentence-builder/index.d.mts +1 -0
- package/dist/language/sentence-builder/preset.d.mts +32 -0
- package/dist/language/sentence-builder/preset.mjs +122 -0
- package/dist/language/transform/index.d.mts +1 -0
- package/dist/language/transform/preset.d.mts +31 -0
- package/dist/language/transform/preset.mjs +137 -0
- package/dist/language/ui.d.mts +53 -0
- package/dist/language/ui.mjs +88 -0
- package/dist/language/word-match/index.d.mts +1 -0
- package/dist/language/word-match/preset.d.mts +22 -0
- package/dist/language/word-match/preset.mjs +148 -0
- package/dist/math/area-model/asset.d.mts +6 -0
- package/dist/math/area-model/asset.mjs +270 -0
- package/dist/math/area-model/index.d.mts +2 -0
- package/dist/math/area-model/preset.d.mts +29 -0
- package/dist/math/area-model/preset.mjs +243 -0
- package/dist/math/balance-algebra/asset.d.mts +6 -0
- package/dist/math/balance-algebra/asset.mjs +150 -0
- package/dist/math/balance-algebra/index.d.mts +2 -0
- package/dist/math/balance-algebra/preset.d.mts +30 -0
- package/dist/math/balance-algebra/preset.mjs +228 -0
- package/dist/math/derivation.d.mts +22 -0
- package/dist/math/derivation.mjs +113 -0
- package/dist/math/derivative-explorer/index.d.mts +1 -0
- package/dist/math/derivative-explorer/preset.d.mts +19 -0
- package/dist/math/derivative-explorer/preset.mjs +227 -0
- package/dist/math/function-machine/index.d.mts +1 -0
- package/dist/math/function-machine/preset.d.mts +21 -0
- package/dist/math/function-machine/preset.mjs +177 -0
- package/dist/math/gradient-descent.d.mts +23 -0
- package/dist/math/gradient-descent.mjs +473 -0
- package/dist/math/grapher/index.d.mts +1 -0
- package/dist/math/grapher/preset.d.mts +40 -0
- package/dist/math/grapher/preset.mjs +313 -0
- package/dist/math/harmonic-form/index.d.mts +1 -0
- package/dist/math/harmonic-form/preset.d.mts +21 -0
- package/dist/math/harmonic-form/preset.mjs +387 -0
- package/dist/math/index.d.mts +25 -0
- package/dist/math/index.mjs +26 -0
- package/dist/math/integral-explorer/index.d.mts +1 -0
- package/dist/math/integral-explorer/preset.d.mts +23 -0
- package/dist/math/integral-explorer/preset.mjs +217 -0
- package/dist/math/interactive/index.d.mts +1 -0
- package/dist/math/interactive/preset.d.mts +72 -0
- package/dist/math/interactive/preset.mjs +202 -0
- package/dist/math/limit-explorer/index.d.mts +1 -0
- package/dist/math/limit-explorer/preset.d.mts +19 -0
- package/dist/math/limit-explorer/preset.mjs +216 -0
- package/dist/math/linear-system/index.d.mts +1 -0
- package/dist/math/linear-system/preset.d.mts +28 -0
- package/dist/math/linear-system/preset.mjs +164 -0
- package/dist/math/mystery-bucket/asset.d.mts +6 -0
- package/dist/math/mystery-bucket/asset.mjs +145 -0
- package/dist/math/mystery-bucket/index.d.mts +2 -0
- package/dist/math/mystery-bucket/preset.d.mts +36 -0
- package/dist/math/mystery-bucket/preset.mjs +116 -0
- package/dist/math/number-line/index.d.mts +1 -0
- package/dist/math/number-line/preset.d.mts +24 -0
- package/dist/math/number-line/preset.mjs +142 -0
- package/dist/math/parabola/index.d.mts +1 -0
- package/dist/math/parabola/preset.d.mts +13 -0
- package/dist/math/parabola/preset.mjs +79 -0
- package/dist/math/pattern/asset.d.mts +6 -0
- package/dist/math/pattern/asset.mjs +102 -0
- package/dist/math/pattern/index.d.mts +2 -0
- package/dist/math/pattern/preset.d.mts +32 -0
- package/dist/math/pattern/preset.mjs +294 -0
- package/dist/math/triangle-trig/index.d.mts +1 -0
- package/dist/math/triangle-trig/preset.d.mts +47 -0
- package/dist/math/triangle-trig/preset.mjs +245 -0
- package/dist/math/trig-explorer.d.mts +18 -0
- package/dist/math/trig-explorer.mjs +209 -0
- package/dist/ml/boundary/index.d.mts +1 -0
- package/dist/ml/boundary/preset.d.mts +24 -0
- package/dist/ml/boundary/preset.mjs +385 -0
- package/dist/ml/classifier/index.d.mts +1 -0
- package/dist/ml/classifier/preset.d.mts +25 -0
- package/dist/ml/classifier/preset.mjs +315 -0
- package/dist/ml/index.d.mts +6 -0
- package/dist/ml/index.mjs +7 -0
- package/dist/ml/kmeans/index.d.mts +1 -0
- package/dist/ml/kmeans/preset.d.mts +33 -0
- package/dist/ml/kmeans/preset.mjs +236 -0
- package/dist/ml/knn/index.d.mts +1 -0
- package/dist/ml/knn/preset.d.mts +28 -0
- package/dist/ml/knn/preset.mjs +279 -0
- package/dist/ml/regression/index.d.mts +1 -0
- package/dist/ml/regression/preset.d.mts +32 -0
- package/dist/ml/regression/preset.mjs +394 -0
- package/dist/physics/atwood/index.d.mts +1 -0
- package/dist/physics/atwood/preset.d.mts +23 -0
- package/dist/physics/atwood/preset.mjs +312 -0
- package/dist/physics/bullet-walls/index.d.mts +1 -0
- package/dist/physics/bullet-walls/preset.d.mts +28 -0
- package/dist/physics/bullet-walls/preset.mjs +373 -0
- package/dist/physics/carnot/index.d.mts +1 -0
- package/dist/physics/carnot/preset.d.mts +27 -0
- package/dist/physics/carnot/preset.mjs +427 -0
- package/dist/physics/circular-motion/index.d.mts +1 -0
- package/dist/physics/circular-motion/preset.d.mts +25 -0
- package/dist/physics/circular-motion/preset.mjs +293 -0
- package/dist/physics/collision-track/index.d.mts +1 -0
- package/dist/physics/collision-track/preset.d.mts +27 -0
- package/dist/physics/collision-track/preset.mjs +352 -0
- package/dist/physics/efficiency/index.d.mts +1 -0
- package/dist/physics/efficiency/preset.d.mts +33 -0
- package/dist/physics/efficiency/preset.mjs +343 -0
- package/dist/physics/electric-field/index.d.mts +1 -0
- package/dist/physics/electric-field/preset.d.mts +15 -0
- package/dist/physics/electric-field/preset.mjs +306 -0
- package/dist/physics/energy-skate/index.d.mts +1 -0
- package/dist/physics/energy-skate/preset.d.mts +25 -0
- package/dist/physics/energy-skate/preset.mjs +254 -0
- package/dist/physics/entropy/index.d.mts +1 -0
- package/dist/physics/entropy/preset.d.mts +18 -0
- package/dist/physics/entropy/preset.mjs +416 -0
- package/dist/physics/expansion/index.d.mts +1 -0
- package/dist/physics/expansion/preset.d.mts +26 -0
- package/dist/physics/expansion/preset.mjs +609 -0
- package/dist/physics/exponential/asset.mjs +221 -0
- package/dist/physics/exponential/index.d.mts +1 -0
- package/dist/physics/exponential/preset.d.mts +17 -0
- package/dist/physics/exponential/preset.mjs +182 -0
- package/dist/physics/gas-process/index.d.mts +1 -0
- package/dist/physics/gas-process/preset.d.mts +30 -0
- package/dist/physics/gas-process/preset.mjs +384 -0
- package/dist/physics/gravitation/index.d.mts +1 -0
- package/dist/physics/gravitation/preset.d.mts +24 -0
- package/dist/physics/gravitation/preset.mjs +345 -0
- package/dist/physics/gravity-drop.d.mts +9 -0
- package/dist/physics/gravity-drop.mjs +187 -0
- package/dist/physics/heat-transfer/index.d.mts +1 -0
- package/dist/physics/heat-transfer/preset.d.mts +27 -0
- package/dist/physics/heat-transfer/preset.mjs +626 -0
- package/dist/physics/impulse/index.d.mts +1 -0
- package/dist/physics/impulse/preset.d.mts +29 -0
- package/dist/physics/impulse/preset.mjs +453 -0
- package/dist/physics/index.d.mts +43 -0
- package/dist/physics/index.mjs +44 -0
- package/dist/physics/kepler/index.d.mts +1 -0
- package/dist/physics/kepler/preset.d.mts +27 -0
- package/dist/physics/kepler/preset.mjs +257 -0
- package/dist/physics/lever/asset.d.mts +6 -0
- package/dist/physics/lever/asset.mjs +220 -0
- package/dist/physics/lever/index.d.mts +2 -0
- package/dist/physics/lever/preset.d.mts +31 -0
- package/dist/physics/lever/preset.mjs +261 -0
- package/dist/physics/lorentz/index.d.mts +1 -0
- package/dist/physics/lorentz/preset.d.mts +29 -0
- package/dist/physics/lorentz/preset.mjs +367 -0
- package/dist/physics/magnetism/index.d.mts +1 -0
- package/dist/physics/magnetism/preset.d.mts +15 -0
- package/dist/physics/magnetism/preset.mjs +334 -0
- package/dist/physics/optics/asset.d.mts +6 -0
- package/dist/physics/optics/asset.mjs +234 -0
- package/dist/physics/optics/index.d.mts +2 -0
- package/dist/physics/optics/preset.d.mts +14 -0
- package/dist/physics/optics/preset.mjs +202 -0
- package/dist/physics/orbit-lab.d.mts +6 -0
- package/dist/physics/orbit-lab.mjs +222 -0
- package/dist/physics/projectile-lab.d.mts +10 -0
- package/dist/physics/projectile-lab.mjs +354 -0
- package/dist/physics/rain-relative/index.d.mts +1 -0
- package/dist/physics/rain-relative/preset.d.mts +19 -0
- package/dist/physics/rain-relative/preset.mjs +358 -0
- package/dist/physics/ramp-forces/index.d.mts +1 -0
- package/dist/physics/ramp-forces/preset.d.mts +36 -0
- package/dist/physics/ramp-forces/preset.mjs +550 -0
- package/dist/physics/river-boat.d.mts +22 -0
- package/dist/physics/river-boat.mjs +498 -0
- package/dist/physics/shm/index.d.mts +1 -0
- package/dist/physics/shm/preset.d.mts +33 -0
- package/dist/physics/shm/preset.mjs +554 -0
- package/dist/physics/stopping-distance/index.d.mts +1 -0
- package/dist/physics/stopping-distance/preset.d.mts +29 -0
- package/dist/physics/stopping-distance/preset.mjs +662 -0
- package/dist/physics/temperature-scales/index.d.mts +1 -0
- package/dist/physics/temperature-scales/preset.d.mts +15 -0
- package/dist/physics/temperature-scales/preset.mjs +353 -0
- package/dist/physics/terminal-velocity/index.d.mts +1 -0
- package/dist/physics/terminal-velocity/preset.d.mts +26 -0
- package/dist/physics/terminal-velocity/preset.mjs +404 -0
- package/dist/physics/thermal/index.d.mts +1 -0
- package/dist/physics/thermal/preset.d.mts +44 -0
- package/dist/physics/thermal/preset.mjs +373 -0
- package/dist/physics/vector-board/index.d.mts +1 -0
- package/dist/physics/vector-board/preset.d.mts +65 -0
- package/dist/physics/vector-board/preset.mjs +273 -0
- package/dist/physics/vector-board/view.d.mts +49 -0
- package/dist/physics/vector-board/view.mjs +58 -0
- package/dist/physics/vector-scene.d.mts +41 -0
- package/dist/physics/vector-scene.mjs +211 -0
- package/dist/physics/vector-types/index.d.mts +1 -0
- package/dist/physics/vector-types/preset.d.mts +27 -0
- package/dist/physics/vector-types/preset.mjs +192 -0
- package/dist/physics/water-density/index.d.mts +1 -0
- package/dist/physics/water-density/preset.d.mts +18 -0
- package/dist/physics/water-density/preset.mjs +439 -0
- package/dist/physics/waves/core.mjs +33 -0
- package/dist/physics/waves/doppler.d.mts +23 -0
- package/dist/physics/waves/doppler.mjs +260 -0
- package/dist/physics/waves/index.d.mts +4 -0
- package/dist/physics/waves/preset.d.mts +30 -0
- package/dist/physics/waves/preset.mjs +488 -0
- package/dist/physics/waves/ripple.d.mts +26 -0
- package/dist/physics/waves/ripple.mjs +234 -0
- package/dist/physics/waves/string.d.mts +29 -0
- package/dist/physics/waves/string.mjs +289 -0
- package/dist/physics/work-energy/index.d.mts +1 -0
- package/dist/physics/work-energy/preset.d.mts +17 -0
- package/dist/physics/work-energy/preset.mjs +341 -0
- package/dist/schemas/index.d.mts +235 -0
- package/dist/schemas/index.mjs +145 -0
- package/dist/statistics/center-spread/preset.d.mts +34 -0
- package/dist/statistics/center-spread/preset.mjs +323 -0
- package/dist/statistics/core/descriptive.d.mts +35 -0
- package/dist/statistics/core/descriptive.mjs +64 -0
- package/dist/statistics/core/normal.d.mts +21 -0
- package/dist/statistics/core/normal.mjs +37 -0
- package/dist/statistics/core/sequences.d.mts +27 -0
- package/dist/statistics/core/sequences.mjs +35 -0
- package/dist/statistics/galton/preset.d.mts +27 -0
- package/dist/statistics/galton/preset.mjs +331 -0
- package/dist/statistics/histogram/preset.d.mts +27 -0
- package/dist/statistics/histogram/preset.mjs +385 -0
- package/dist/statistics/index.d.mts +11 -0
- package/dist/statistics/index.mjs +12 -0
- package/dist/statistics/normal/preset.d.mts +30 -0
- package/dist/statistics/normal/preset.mjs +400 -0
- package/dist/statistics/sampling/preset.d.mts +32 -0
- package/dist/statistics/sampling/preset.mjs +406 -0
- package/dist/statistics/sequence/preset.d.mts +28 -0
- package/dist/statistics/sequence/preset.mjs +302 -0
- package/dist/statistics/z-table/preset.d.mts +28 -0
- package/dist/statistics/z-table/preset.mjs +348 -0
- package/package.json +266 -0
- package/styles.css +267 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { clamp, num, toDeg, toRad } from "../core/util.mjs";
|
|
4
|
+
import { Tex as Tex$1 } from "../core/tex.mjs";
|
|
5
|
+
import { Chip, Slider } from "../kit/controls.mjs";
|
|
6
|
+
import { Callout, ControlBar, Field, LabFrame } from "../kit/frame.mjs";
|
|
7
|
+
import { LabeledVector } from "../kit/diagram.mjs";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Dot, Grid, Label, Polygon, Segment, Stage, fmt, useControlSurface, useCoords } from "@classytic/stage";
|
|
11
|
+
|
|
12
|
+
//#region src/physics/river-boat.tsx
|
|
13
|
+
/**
|
|
14
|
+
* RiverBoat — the classic "boat crossing a flowing river" vector problem, the one
|
|
15
|
+
* that trips students on component resolution. A boat aims across the current at a
|
|
16
|
+
* heading θ; the river carries it downstream. Walk the steps to SEE why you add
|
|
17
|
+
* the boat and current velocities tip-to-tail, then resolve the resultant into
|
|
18
|
+
* an "across" component (v_b·cosθ, sets crossing time) and a "downstream"
|
|
19
|
+
* component (v_c − v_b·sinθ, sets the drift). Aim upstream at θ = arcsin(v_c/v_b)
|
|
20
|
+
* and the drift cancels — you land straight across.
|
|
21
|
+
*
|
|
22
|
+
* Now on the @classytic/stage engine (SVG vectors via the shared `LabeledVector`
|
|
23
|
+
* helper, accessible, themed); keeps the agent `useControlSurface` seam.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* A small boat anchored at the launch point (math origin), heading `thetaDeg`
|
|
27
|
+
* upstream from straight-across. Fixed on-screen size (a constant glyph, like an
|
|
28
|
+
* angle mark), rotated via a transform with static local coordinates — nose
|
|
29
|
+
* points along +across, so rotate(−θ) aims it upstream. SSR-safe: no
|
|
30
|
+
* transcendental-derived coordinate is serialized.
|
|
31
|
+
*/
|
|
32
|
+
function BoatGlyph({ thetaDeg }) {
|
|
33
|
+
const [ox, oy] = useCoords().toPx(0, 0);
|
|
34
|
+
const hull = "var(--stage-metal)";
|
|
35
|
+
const edge = "color-mix(in oklab, var(--stage-metal) 60%, black)";
|
|
36
|
+
const sheen = "color-mix(in oklab, var(--stage-sheen) 50%, transparent)";
|
|
37
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
38
|
+
transform: `translate(${fmt(ox)},${fmt(oy)}) rotate(${fmt(-thetaDeg)})`,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx("path", {
|
|
41
|
+
d: "M -2.4 10 L -3.6 18 M 2.4 10 L 3.6 18",
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: sheen,
|
|
44
|
+
strokeWidth: 1.1,
|
|
45
|
+
strokeDasharray: "2 3",
|
|
46
|
+
opacity: .6,
|
|
47
|
+
strokeLinecap: "round"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("ellipse", {
|
|
50
|
+
cx: 0,
|
|
51
|
+
cy: 2,
|
|
52
|
+
rx: 6.5,
|
|
53
|
+
ry: 9,
|
|
54
|
+
fill: "color-mix(in oklab, black 60%, transparent)",
|
|
55
|
+
opacity: .12
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsx("path", {
|
|
58
|
+
d: "M 0 -12 C 4.6 -5 5.6 4 4 10 L -4 10 C -5.6 4 -4.6 -5 0 -12 Z",
|
|
59
|
+
fill: hull,
|
|
60
|
+
stroke: edge,
|
|
61
|
+
strokeWidth: 1,
|
|
62
|
+
strokeLinejoin: "round"
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsx("path", {
|
|
65
|
+
d: "M -3.2 7 C -4.4 2 -3.4 -3 0 -8.5",
|
|
66
|
+
fill: "none",
|
|
67
|
+
stroke: sheen,
|
|
68
|
+
strokeWidth: .9,
|
|
69
|
+
opacity: .55
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx("rect", {
|
|
72
|
+
x: -2.6,
|
|
73
|
+
y: -1.5,
|
|
74
|
+
width: 5.2,
|
|
75
|
+
height: 4,
|
|
76
|
+
rx: 1.2,
|
|
77
|
+
fill: "var(--stage-bg)",
|
|
78
|
+
stroke: edge,
|
|
79
|
+
strokeWidth: .6
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx("circle", {
|
|
82
|
+
cx: 0,
|
|
83
|
+
cy: -9,
|
|
84
|
+
r: 1.1,
|
|
85
|
+
fill: "var(--stage-accent)"
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Wave streaks drifting downstream, illustrating the current. Drift speed scales
|
|
92
|
+
* with `current` (vᵧ) — a still river is calm, a fast one streams. Animated with
|
|
93
|
+
* a CSS keyframe (declarative, SSR-safe, honours prefers-reduced-motion); the
|
|
94
|
+
* dash period equals the keyframe translate, so the loop is seamless.
|
|
95
|
+
*/
|
|
96
|
+
function RiverWaves({ view, W, current }) {
|
|
97
|
+
const c = useCoords();
|
|
98
|
+
if (current <= .01) return null;
|
|
99
|
+
const leftX = c.toPx(view.xMin, 0)[0] - 40;
|
|
100
|
+
const rightX = c.toPx(view.xMax, 0)[0] + 40;
|
|
101
|
+
const speed = current * c.sx(1) * .3;
|
|
102
|
+
const dur = Math.max(1.2, Math.min(14, 28 / speed));
|
|
103
|
+
const ys = [
|
|
104
|
+
.16,
|
|
105
|
+
.38,
|
|
106
|
+
.6,
|
|
107
|
+
.82,
|
|
108
|
+
.96
|
|
109
|
+
].map((f) => c.toPx(0, f * W)[1]);
|
|
110
|
+
return /* @__PURE__ */ jsx("g", {
|
|
111
|
+
className: "lab-river-wave",
|
|
112
|
+
style: { animationDuration: `${dur}s` },
|
|
113
|
+
children: ys.map((y, i) => /* @__PURE__ */ jsx("line", {
|
|
114
|
+
x1: fmt(leftX),
|
|
115
|
+
y1: fmt(y),
|
|
116
|
+
x2: fmt(rightX),
|
|
117
|
+
y2: fmt(y),
|
|
118
|
+
stroke: "var(--stage-accent)",
|
|
119
|
+
strokeWidth: 1.4,
|
|
120
|
+
strokeLinecap: "round",
|
|
121
|
+
strokeDasharray: "10 18",
|
|
122
|
+
strokeDashoffset: i % 2 ? 9 : 0,
|
|
123
|
+
opacity: .42
|
|
124
|
+
}, i))
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const STEPS = [
|
|
128
|
+
"Aim the boat across — this is its velocity through the water.",
|
|
129
|
+
"The river flows, pushing the boat downstream at vᵧ.",
|
|
130
|
+
"Add them tip-to-tail: the resultant is the boat’s true path over the ground.",
|
|
131
|
+
"Resolve the resultant: across = vᵦ·cos θ, downstream = vᵧ − vᵦ·sin θ.",
|
|
132
|
+
"Across speed sets the crossing time; the leftover downstream speed is the drift."
|
|
133
|
+
];
|
|
134
|
+
function RiverBoat({ boatSpeed, current, riverWidth, title = "Crossing a flowing river", height = 360, controlId } = {}) {
|
|
135
|
+
const W = clamp(num(riverWidth, 8), 3, 14);
|
|
136
|
+
const [vb, setVb] = useState(clamp(num(boatSpeed, 4), .5, 10));
|
|
137
|
+
const [vc, setVc] = useState(clamp(num(current, 2), 0, 8));
|
|
138
|
+
const [theta, setTheta] = useState(0);
|
|
139
|
+
const [step, setStep] = useState(0);
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
setVb(clamp(num(boatSpeed, 4), .5, 10));
|
|
142
|
+
}, [boatSpeed]);
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
setVc(clamp(num(current, 2), 0, 8));
|
|
145
|
+
}, [current]);
|
|
146
|
+
useControlSurface(controlId, {
|
|
147
|
+
heading: {
|
|
148
|
+
type: "number",
|
|
149
|
+
label: "heading θ (° upstream)",
|
|
150
|
+
min: -60,
|
|
151
|
+
max: 60,
|
|
152
|
+
get: () => theta,
|
|
153
|
+
set: setTheta
|
|
154
|
+
},
|
|
155
|
+
boatSpeed: {
|
|
156
|
+
type: "number",
|
|
157
|
+
label: "boat speed",
|
|
158
|
+
min: .5,
|
|
159
|
+
max: 10,
|
|
160
|
+
unit: "m/s",
|
|
161
|
+
get: () => vb,
|
|
162
|
+
set: setVb
|
|
163
|
+
},
|
|
164
|
+
current: {
|
|
165
|
+
type: "number",
|
|
166
|
+
label: "current",
|
|
167
|
+
min: 0,
|
|
168
|
+
max: 8,
|
|
169
|
+
unit: "m/s",
|
|
170
|
+
get: () => vc,
|
|
171
|
+
set: setVc
|
|
172
|
+
},
|
|
173
|
+
step: {
|
|
174
|
+
type: "number",
|
|
175
|
+
label: "walkthrough step",
|
|
176
|
+
min: 0,
|
|
177
|
+
max: STEPS.length - 1,
|
|
178
|
+
get: () => step,
|
|
179
|
+
set: (v) => setStep(Math.round(v))
|
|
180
|
+
},
|
|
181
|
+
aimStraight: {
|
|
182
|
+
type: "action",
|
|
183
|
+
label: "aim to land straight across",
|
|
184
|
+
invoke: () => setTheta(toDeg(Math.asin(clamp(vc / vb, -1, 1))))
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
const rad = toRad(theta);
|
|
188
|
+
const across = vb * Math.cos(rad);
|
|
189
|
+
const downstream = vc - vb * Math.sin(rad);
|
|
190
|
+
const cross = across > .001;
|
|
191
|
+
const tCross = cross ? W / across : Infinity;
|
|
192
|
+
const drift = cross ? downstream * tCross : Infinity;
|
|
193
|
+
const view = {
|
|
194
|
+
xMin: -3,
|
|
195
|
+
xMax: 15,
|
|
196
|
+
yMin: -2,
|
|
197
|
+
yMax: W + 3
|
|
198
|
+
};
|
|
199
|
+
const boatV = {
|
|
200
|
+
x: -vb * Math.sin(rad),
|
|
201
|
+
y: vb * Math.cos(rad)
|
|
202
|
+
};
|
|
203
|
+
const curV = {
|
|
204
|
+
x: vc,
|
|
205
|
+
y: 0
|
|
206
|
+
};
|
|
207
|
+
const resV = {
|
|
208
|
+
x: boatV.x + curV.x,
|
|
209
|
+
y: boatV.y + curV.y
|
|
210
|
+
};
|
|
211
|
+
const canLandStraight = vc <= vb;
|
|
212
|
+
const aimStraight = () => setTheta(toDeg(Math.asin(clamp(vc / vb, -1, 1))));
|
|
213
|
+
const figure = /* @__PURE__ */ jsx("div", {
|
|
214
|
+
style: {
|
|
215
|
+
borderRadius: 14,
|
|
216
|
+
overflow: "hidden",
|
|
217
|
+
background: "var(--stage-bg)",
|
|
218
|
+
border: "1px solid var(--stage-grid)"
|
|
219
|
+
},
|
|
220
|
+
children: /* @__PURE__ */ jsxs(Stage, {
|
|
221
|
+
view,
|
|
222
|
+
height,
|
|
223
|
+
ariaLabel: `River-crossing vector diagram, step ${step + 1} of ${STEPS.length}`,
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsx(Grid, {}),
|
|
226
|
+
/* @__PURE__ */ jsx(Polygon, {
|
|
227
|
+
points: [
|
|
228
|
+
{
|
|
229
|
+
x: view.xMin,
|
|
230
|
+
y: 0
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
x: view.xMax,
|
|
234
|
+
y: 0
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
x: view.xMax,
|
|
238
|
+
y: W
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
x: view.xMin,
|
|
242
|
+
y: W
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
color: "none",
|
|
246
|
+
fill: "var(--stage-accent)",
|
|
247
|
+
fillOpacity: .1
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ jsx(RiverWaves, {
|
|
250
|
+
view,
|
|
251
|
+
W,
|
|
252
|
+
current: vc
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
255
|
+
from: {
|
|
256
|
+
x: view.xMin,
|
|
257
|
+
y: 0
|
|
258
|
+
},
|
|
259
|
+
to: {
|
|
260
|
+
x: view.xMax,
|
|
261
|
+
y: 0
|
|
262
|
+
},
|
|
263
|
+
color: "var(--stage-fg)",
|
|
264
|
+
opacity: .4,
|
|
265
|
+
weight: 2
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
268
|
+
from: {
|
|
269
|
+
x: view.xMin,
|
|
270
|
+
y: W
|
|
271
|
+
},
|
|
272
|
+
to: {
|
|
273
|
+
x: view.xMax,
|
|
274
|
+
y: W
|
|
275
|
+
},
|
|
276
|
+
color: "var(--stage-fg)",
|
|
277
|
+
opacity: .4,
|
|
278
|
+
weight: 2
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ jsx(Label, {
|
|
281
|
+
x: view.xMax - 1,
|
|
282
|
+
y: 0,
|
|
283
|
+
text: "start bank",
|
|
284
|
+
color: "var(--stage-fg)",
|
|
285
|
+
anchor: "end",
|
|
286
|
+
dy: 14,
|
|
287
|
+
size: 12
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ jsx(Label, {
|
|
290
|
+
x: view.xMax - 1,
|
|
291
|
+
y: W,
|
|
292
|
+
text: "far bank",
|
|
293
|
+
color: "var(--stage-fg)",
|
|
294
|
+
anchor: "end",
|
|
295
|
+
dy: -10,
|
|
296
|
+
size: 12
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
299
|
+
x: 0,
|
|
300
|
+
y: W,
|
|
301
|
+
r: 4,
|
|
302
|
+
color: "var(--stage-fg)",
|
|
303
|
+
opacity: .5
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ jsx(LabeledVector, {
|
|
306
|
+
tail: {
|
|
307
|
+
x: 0,
|
|
308
|
+
y: 0
|
|
309
|
+
},
|
|
310
|
+
comp: boatV,
|
|
311
|
+
color: "var(--stage-accent)",
|
|
312
|
+
label: "boat vᵦ"
|
|
313
|
+
}),
|
|
314
|
+
step >= 1 && /* @__PURE__ */ jsx(LabeledVector, {
|
|
315
|
+
tail: {
|
|
316
|
+
x: 0,
|
|
317
|
+
y: 0
|
|
318
|
+
},
|
|
319
|
+
comp: curV,
|
|
320
|
+
color: "var(--stage-accent-2)",
|
|
321
|
+
label: "current vᵧ"
|
|
322
|
+
}),
|
|
323
|
+
step >= 2 && /* @__PURE__ */ jsx(LabeledVector, {
|
|
324
|
+
tail: boatV,
|
|
325
|
+
comp: curV,
|
|
326
|
+
color: "var(--stage-accent-2)",
|
|
327
|
+
weight: 1.5
|
|
328
|
+
}),
|
|
329
|
+
step >= 2 && /* @__PURE__ */ jsx(LabeledVector, {
|
|
330
|
+
tail: {
|
|
331
|
+
x: 0,
|
|
332
|
+
y: 0
|
|
333
|
+
},
|
|
334
|
+
comp: resV,
|
|
335
|
+
color: "var(--stage-good)",
|
|
336
|
+
weight: 3,
|
|
337
|
+
components: step >= 3,
|
|
338
|
+
label: "resultant"
|
|
339
|
+
}),
|
|
340
|
+
step >= 4 && cross && /* @__PURE__ */ jsx(Segment, {
|
|
341
|
+
from: {
|
|
342
|
+
x: 0,
|
|
343
|
+
y: 0
|
|
344
|
+
},
|
|
345
|
+
to: {
|
|
346
|
+
x: drift,
|
|
347
|
+
y: W
|
|
348
|
+
},
|
|
349
|
+
color: "var(--stage-good)",
|
|
350
|
+
weight: 1.5,
|
|
351
|
+
dashed: true
|
|
352
|
+
}),
|
|
353
|
+
step >= 4 && cross && /* @__PURE__ */ jsx(Dot, {
|
|
354
|
+
x: drift,
|
|
355
|
+
y: W,
|
|
356
|
+
r: 6,
|
|
357
|
+
color: "var(--stage-good)"
|
|
358
|
+
}),
|
|
359
|
+
step >= 4 && cross && /* @__PURE__ */ jsx(Label, {
|
|
360
|
+
x: drift,
|
|
361
|
+
y: W,
|
|
362
|
+
text: "lands here",
|
|
363
|
+
color: "var(--stage-good)",
|
|
364
|
+
dy: -12,
|
|
365
|
+
size: 12
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ jsx(BoatGlyph, { thetaDeg: theta }),
|
|
368
|
+
" "
|
|
369
|
+
]
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
const aside = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Callout, {
|
|
373
|
+
tone: "result",
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ jsx("span", {
|
|
376
|
+
style: {
|
|
377
|
+
fontSize: 12,
|
|
378
|
+
color: "var(--stage-muted)",
|
|
379
|
+
fontWeight: 600
|
|
380
|
+
},
|
|
381
|
+
children: cross ? "crossing" : "no progress across"
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ jsx("span", {
|
|
384
|
+
style: {
|
|
385
|
+
fontSize: 15,
|
|
386
|
+
fontWeight: 800,
|
|
387
|
+
fontVariantNumeric: "tabular-nums"
|
|
388
|
+
},
|
|
389
|
+
children: cross ? `lands ${drift.toFixed(1)} m downstream` : "—"
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsx("span", {
|
|
392
|
+
style: {
|
|
393
|
+
fontSize: 12,
|
|
394
|
+
color: "var(--stage-muted)"
|
|
395
|
+
},
|
|
396
|
+
children: cross ? `t = ${tCross.toFixed(1)} s` : "aim less upstream"
|
|
397
|
+
})
|
|
398
|
+
]
|
|
399
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
400
|
+
style: {
|
|
401
|
+
display: "grid",
|
|
402
|
+
gap: 4,
|
|
403
|
+
fontSize: 13
|
|
404
|
+
},
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ jsx(Tex$1, { tex: `v_{across} = v_b\\cos\\theta = ${across.toFixed(2)}` }),
|
|
407
|
+
/* @__PURE__ */ jsx(Tex$1, { tex: `v_{down} = v_c - v_b\\sin\\theta = ${downstream.toFixed(2)}` }),
|
|
408
|
+
cross && /* @__PURE__ */ jsx(Tex$1, { tex: `t = W/(v_b\\cos\\theta) = ${tCross.toFixed(1)}\\,\\text{s}` })
|
|
409
|
+
]
|
|
410
|
+
})] });
|
|
411
|
+
const controls = /* @__PURE__ */ jsxs(ControlBar, { children: [
|
|
412
|
+
/* @__PURE__ */ jsxs("span", {
|
|
413
|
+
style: {
|
|
414
|
+
gridColumn: "1 / -1",
|
|
415
|
+
display: "inline-flex",
|
|
416
|
+
gap: 6,
|
|
417
|
+
alignItems: "center",
|
|
418
|
+
flexWrap: "wrap"
|
|
419
|
+
},
|
|
420
|
+
children: [
|
|
421
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
422
|
+
selected: false,
|
|
423
|
+
onClick: () => setStep((s) => Math.max(0, s - 1)),
|
|
424
|
+
children: "← Back"
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ jsxs("span", {
|
|
427
|
+
style: {
|
|
428
|
+
fontVariantNumeric: "tabular-nums",
|
|
429
|
+
opacity: .75,
|
|
430
|
+
fontSize: 13
|
|
431
|
+
},
|
|
432
|
+
children: [
|
|
433
|
+
"step ",
|
|
434
|
+
step + 1,
|
|
435
|
+
"/",
|
|
436
|
+
STEPS.length
|
|
437
|
+
]
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ jsx(Chip, {
|
|
440
|
+
selected: false,
|
|
441
|
+
onClick: () => setStep((s) => Math.min(STEPS.length - 1, s + 1)),
|
|
442
|
+
children: "Next →"
|
|
443
|
+
}),
|
|
444
|
+
canLandStraight && /* @__PURE__ */ jsx(Chip, {
|
|
445
|
+
selected: false,
|
|
446
|
+
onClick: aimStraight,
|
|
447
|
+
children: "aim straight"
|
|
448
|
+
})
|
|
449
|
+
]
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ jsx(Field, {
|
|
452
|
+
label: "boat vᵦ",
|
|
453
|
+
value: vb.toFixed(1),
|
|
454
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
455
|
+
value: vb,
|
|
456
|
+
min: .5,
|
|
457
|
+
max: 10,
|
|
458
|
+
step: .1,
|
|
459
|
+
onChange: setVb,
|
|
460
|
+
ariaLabel: "boat speed"
|
|
461
|
+
})
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ jsx(Field, {
|
|
464
|
+
label: "current vᵧ",
|
|
465
|
+
value: vc.toFixed(1),
|
|
466
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
467
|
+
value: vc,
|
|
468
|
+
min: 0,
|
|
469
|
+
max: 8,
|
|
470
|
+
step: .1,
|
|
471
|
+
onChange: setVc,
|
|
472
|
+
ariaLabel: "current speed"
|
|
473
|
+
})
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ jsx(Field, {
|
|
476
|
+
label: "θ (° up)",
|
|
477
|
+
value: theta.toFixed(0),
|
|
478
|
+
children: /* @__PURE__ */ jsx(Slider, {
|
|
479
|
+
value: theta,
|
|
480
|
+
min: -60,
|
|
481
|
+
max: 60,
|
|
482
|
+
step: 1,
|
|
483
|
+
onChange: setTheta,
|
|
484
|
+
ariaLabel: "heading upstream"
|
|
485
|
+
})
|
|
486
|
+
})
|
|
487
|
+
] });
|
|
488
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
489
|
+
title,
|
|
490
|
+
prompt: STEPS[step],
|
|
491
|
+
aside,
|
|
492
|
+
controls,
|
|
493
|
+
children: figure
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
//#endregion
|
|
498
|
+
export { RiverBoat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { SHMMode, SimpleHarmonicLab, SimpleHarmonicProps } from "./preset.mjs";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ControlConfig } from "../../kit/frame.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/physics/shm/preset.d.ts
|
|
5
|
+
type SHMMode = 'spring' | 'pendulum';
|
|
6
|
+
interface SimpleHarmonicProps {
|
|
7
|
+
mode?: SHMMode;
|
|
8
|
+
/** Spring stiffness k (N/m). */
|
|
9
|
+
k?: number;
|
|
10
|
+
/** Pendulum length L (m). */
|
|
11
|
+
length?: number;
|
|
12
|
+
mass?: number;
|
|
13
|
+
/** Amplitude: metres (spring) or degrees (pendulum). */
|
|
14
|
+
amplitude?: number;
|
|
15
|
+
title?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
objectives?: string[];
|
|
18
|
+
/** Focus a lesson: set `mode` + `controlConfig:{ hide:['mode'] }` for spring-only or pendulum-only. */
|
|
19
|
+
controlConfig?: ControlConfig;
|
|
20
|
+
}
|
|
21
|
+
declare function SimpleHarmonicLab({
|
|
22
|
+
mode,
|
|
23
|
+
k,
|
|
24
|
+
length,
|
|
25
|
+
mass,
|
|
26
|
+
amplitude,
|
|
27
|
+
title,
|
|
28
|
+
prompt,
|
|
29
|
+
objectives,
|
|
30
|
+
controlConfig
|
|
31
|
+
}: SimpleHarmonicProps): ReactNode;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { SHMMode, SimpleHarmonicLab, SimpleHarmonicProps };
|