@classytic/labs 0.1.0 → 0.2.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/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/biology/enzyme-rate/preset.mjs +5 -5
- package/dist/biology/genetic-cross/core.d.mts +7 -7
- package/dist/biology/genetic-cross/core.mjs +4 -4
- package/dist/biology/genetic-cross/grid.mjs +132 -123
- package/dist/biology/genetic-cross/preset.mjs +4 -4
- package/dist/biology/genetic-cross/sex-linked.mjs +7 -7
- package/dist/biology/photosynthesis-factors/preset.mjs +8 -8
- package/dist/biology/respiration/preset.mjs +4 -4
- package/dist/biology/sequence/central-dogma.mjs +5 -5
- package/dist/biology/sequence/core.d.mts +6 -6
- package/dist/biology/sequence/core.mjs +1 -1
- package/dist/biology/sequence/preset.mjs +6 -6
- package/dist/blocks/authoring.mjs +5 -5
- package/dist/blocks/biology.d.mts +2 -2
- package/dist/blocks/biology.mjs +5 -5
- package/dist/blocks/chem.d.mts +2 -2
- package/dist/blocks/chem.mjs +13 -13
- package/dist/blocks/circuits.d.mts +293 -4
- package/dist/blocks/circuits.mjs +874 -9
- package/dist/blocks/discrete.d.mts +30 -2
- package/dist/blocks/discrete.mjs +74 -4
- package/dist/blocks/economics.mjs +1 -1
- package/dist/blocks/geography.mjs +1 -1
- package/dist/blocks/geometry.mjs +3 -3
- package/dist/blocks/ict.d.mts +90 -1
- package/dist/blocks/ict.mjs +217 -7
- package/dist/blocks/index.d.mts +3064 -657
- package/dist/blocks/index.mjs +9 -9
- package/dist/blocks/lab-block.mjs +5 -5
- package/dist/blocks/lab-config.d.mts +1 -1
- package/dist/blocks/lab-config.mjs +4 -4
- package/dist/blocks/lab-gallery.d.mts +1 -1
- package/dist/blocks/lab-gallery.mjs +2 -2
- package/dist/blocks/language.d.mts +6 -6
- package/dist/blocks/language.mjs +12 -12
- package/dist/blocks/lesson.mjs +4 -4
- package/dist/blocks/math.d.mts +577 -11
- package/dist/blocks/math.mjs +1648 -14
- package/dist/blocks/ml.d.mts +45 -1
- package/dist/blocks/ml.mjs +80 -6
- package/dist/blocks/physics.d.mts +9 -4
- package/dist/blocks/physics.mjs +75 -28
- package/dist/blocks/statistics.mjs +1 -1
- package/dist/build/CircuitEditor.d.mts +14 -0
- package/dist/build/CircuitEditor.mjs +787 -0
- package/dist/build/CircuitPlayer.d.mts +19 -0
- package/dist/build/CircuitPlayer.mjs +53 -0
- package/dist/build/CircuitScene.d.mts +61 -0
- package/dist/build/CircuitScene.mjs +383 -0
- package/dist/build/contract.d.mts +116 -0
- package/dist/build/editor-ops.d.mts +65 -0
- package/dist/build/editor-ops.mjs +306 -0
- package/dist/build/editor-ui.mjs +121 -0
- package/dist/build/flow.d.mts +14 -0
- package/dist/build/flow.mjs +119 -0
- package/dist/build/index.d.mts +10 -0
- package/dist/build/index.mjs +10 -0
- package/dist/build/parts/ammeter.d.mts +1 -0
- package/dist/build/parts/ammeter.mjs +32 -0
- package/dist/build/parts/bulb.d.mts +1 -0
- package/dist/build/parts/bulb.mjs +50 -0
- package/dist/build/parts/capacitor.d.mts +1 -0
- package/dist/build/parts/capacitor.mjs +26 -0
- package/dist/build/parts/cell.d.mts +1 -0
- package/dist/build/parts/cell.mjs +40 -0
- package/dist/build/parts/diode.d.mts +1 -0
- package/dist/build/parts/diode.mjs +33 -0
- package/dist/build/parts/index.d.mts +5 -0
- package/dist/build/parts/index.mjs +43 -0
- package/dist/build/parts/mosfet.d.mts +1 -0
- package/dist/build/parts/mosfet.mjs +95 -0
- package/dist/build/parts/node.d.mts +1 -0
- package/dist/build/parts/node.mjs +32 -0
- package/dist/build/parts/resistor.d.mts +1 -0
- package/dist/build/parts/resistor.mjs +49 -0
- package/dist/build/parts/shared.mjs +42 -0
- package/dist/build/parts/switch.d.mts +1 -0
- package/dist/build/parts/switch.mjs +34 -0
- package/dist/build/parts.d.mts +1 -0
- package/dist/build/registry.d.mts +9 -0
- package/dist/build/registry.mjs +15 -0
- package/dist/build/solve.d.mts +8 -0
- package/dist/build/solve.mjs +0 -0
- package/dist/catalog/registry.d.mts +2 -2
- package/dist/catalog/templates.d.mts +1 -1
- package/dist/catalog/templates.mjs +6 -6
- package/dist/chem/battery.mjs +1 -1
- package/dist/chem/bohr-atom.mjs +4 -4
- package/dist/chem/diffusion/preset.mjs +4 -4
- package/dist/chem/electrochem/preset.mjs +5 -5
- package/dist/chem/equilibrium/preset.d.mts +1 -1
- package/dist/chem/equilibrium/preset.mjs +6 -6
- package/dist/chem/gas-box/preset.mjs +6 -6
- package/dist/chem/kinetics/preset.mjs +6 -6
- package/dist/chem/periodic-trends/preset.mjs +7 -7
- package/dist/chem/reaction-lab.mjs +3 -3
- package/dist/chem/reaction-profile.mjs +4 -4
- package/dist/chem/solution/dilution.mjs +6 -6
- package/dist/chem/solution/field.d.mts +2 -2
- package/dist/chem/solution/field.mjs +2 -2
- package/dist/chem/solution/solution-box.mjs +7 -7
- package/dist/chem/stoichiometry/preset.mjs +5 -5
- package/dist/chem/titration/preset.mjs +5 -5
- package/dist/circuits/ac-dc/asset.mjs +1 -1
- package/dist/circuits/ac-dc/preset.mjs +2 -2
- package/dist/circuits/brownout/index.d.mts +1 -0
- package/dist/circuits/brownout/preset.d.mts +22 -0
- package/dist/circuits/brownout/preset.mjs +399 -0
- package/dist/circuits/capacitor-leak/preset.mjs +13 -8
- package/dist/circuits/circuit/asset.mjs +71 -14
- package/dist/circuits/circuit/preset.mjs +23 -5
- package/dist/circuits/circuit-builder.mjs +60 -132
- package/dist/circuits/circuit-lab.mjs +60 -40
- package/dist/circuits/cmos-gate/index.d.mts +1 -0
- package/dist/circuits/cmos-gate/preset.d.mts +75 -0
- package/dist/circuits/cmos-gate/preset.mjs +1491 -0
- package/dist/circuits/diode/index.d.mts +1 -0
- package/dist/circuits/diode/preset.d.mts +25 -0
- package/dist/circuits/diode/preset.mjs +266 -0
- package/dist/circuits/index.d.mts +7 -1
- package/dist/circuits/index.mjs +7 -1
- package/dist/circuits/rc-charging/index.d.mts +1 -0
- package/dist/circuits/rc-charging/preset.d.mts +27 -0
- package/dist/circuits/rc-charging/preset.mjs +329 -0
- package/dist/circuits/semiconductor/index.d.mts +1 -0
- package/dist/circuits/semiconductor/preset.d.mts +102 -0
- package/dist/circuits/semiconductor/preset.mjs +1855 -0
- package/dist/circuits/transistor/index.d.mts +1 -0
- package/dist/circuits/transistor/preset.d.mts +27 -0
- package/dist/circuits/transistor/preset.mjs +329 -0
- package/dist/commerce/accounting/core.d.mts +1 -1
- package/dist/commerce/accounting/equation-balance.mjs +5 -5
- package/dist/commerce/accounting/journal-poster.mjs +8 -8
- package/dist/commerce/accounting/statement-sorter.mjs +4 -4
- package/dist/commerce/economics/core.d.mts +2 -2
- package/dist/commerce/economics/core.mjs +1 -1
- package/dist/commerce/economics/demand-shift-vs-move.mjs +6 -6
- package/dist/commerce/economics/elasticity-revenue.mjs +6 -6
- package/dist/commerce/economics/market-equilibrium.mjs +5 -5
- package/dist/core/easing.d.mts +3 -3
- package/dist/core/easing.mjs +2 -2
- package/dist/core/numeric.d.mts +3 -3
- package/dist/core/numeric.mjs +2 -2
- package/dist/core/reactive.d.mts +1 -1
- package/dist/core/reactive.mjs +1 -1
- package/dist/core/rng.d.mts +2 -2
- package/dist/core/rng.mjs +1 -1
- package/dist/core/tex.mjs +2 -2
- package/dist/core/timeline.d.mts +1 -1
- package/dist/core/timeline.mjs +1 -1
- package/dist/core/util.mjs +11 -1
- package/dist/discrete/arrangements/preset.mjs +6 -14
- package/dist/discrete/bayes/preset.mjs +43 -35
- package/dist/discrete/binomial/preset.mjs +2 -2
- package/dist/discrete/combination-studio/figure.d.mts +6 -0
- package/dist/discrete/combination-studio/figure.mjs +159 -0
- package/dist/discrete/combination-studio/index.d.mts +2 -0
- package/dist/discrete/combination-studio/preset.d.mts +44 -0
- package/dist/discrete/combination-studio/preset.mjs +440 -0
- package/dist/discrete/core/combinatorics.d.mts +23 -3
- package/dist/discrete/core/combinatorics.mjs +38 -3
- package/dist/discrete/core/pigeonhole.d.mts +1 -1
- package/dist/discrete/core/pigeonhole.mjs +1 -1
- package/dist/discrete/core/probability.d.mts +3 -3
- package/dist/discrete/core/probability.mjs +3 -3
- package/dist/discrete/core/sets.d.mts +1 -1
- package/dist/discrete/counting-slots/preset.mjs +8 -8
- package/dist/discrete/counting-tree/preset.mjs +65 -8
- package/dist/discrete/expected-value/preset.mjs +13 -13
- package/dist/discrete/hypergeometric/preset.mjs +48 -15
- package/dist/discrete/index.d.mts +4 -2
- package/dist/discrete/index.mjs +4 -2
- package/dist/discrete/karnaugh/preset.mjs +26 -20
- package/dist/discrete/lln/preset.mjs +44 -3
- package/dist/discrete/logic-circuit/preset.mjs +2 -2
- package/dist/discrete/monte-carlo/preset.d.mts +1 -1
- package/dist/discrete/monte-carlo/preset.mjs +14 -14
- package/dist/discrete/monty-hall/preset.mjs +6 -6
- package/dist/discrete/outcome-builder/preset.mjs +3 -3
- package/dist/discrete/pascal/preset.mjs +37 -7
- package/dist/discrete/rules.d.mts +20 -0
- package/dist/discrete/rules.mjs +264 -0
- package/dist/discrete/sample-space/preset.mjs +4 -4
- package/dist/discrete/selection/preset.mjs +7 -13
- package/dist/discrete/truth-table/preset.mjs +32 -9
- package/dist/discrete/venn/preset.mjs +71 -48
- package/dist/geography/cycle-lab/preset.mjs +17 -10
- package/dist/geography/cycles.d.mts +3 -3
- package/dist/geography/cycles.mjs +3 -3
- package/dist/geometry/board/preset.d.mts +2 -0
- package/dist/geometry/board/preset.mjs +11 -15
- package/dist/geometry/builder.mjs +3 -3
- package/dist/ict/number-systems/base-odometer.mjs +4 -4
- package/dist/ict/number-systems/bit-grouper.d.mts +1 -1
- package/dist/ict/number-systems/bit-grouper.mjs +4 -4
- package/dist/ict/number-systems/place-value-dial.d.mts +1 -1
- package/dist/ict/number-systems/place-value-dial.mjs +3 -3
- package/dist/ict/number-systems/wheel.d.mts +3 -3
- package/dist/ict/number-systems/wheel.mjs +4 -4
- package/dist/kit/annotate.mjs +3 -3
- package/dist/kit/answer-check.d.mts +2 -2
- package/dist/kit/answer-check.mjs +34 -6
- package/dist/kit/ask.d.mts +19 -0
- package/dist/kit/ask.mjs +46 -0
- package/dist/kit/bar-strip.mjs +53 -0
- package/dist/kit/calc.d.mts +33 -0
- package/dist/kit/calc.mjs +27 -0
- package/dist/kit/carrier-engine.mjs +147 -0
- package/dist/kit/clue-scene.d.mts +86 -0
- package/dist/kit/clue-scene.mjs +424 -0
- package/dist/kit/cluster.d.mts +30 -0
- package/dist/kit/cluster.mjs +81 -0
- package/dist/kit/controls.mjs +11 -5
- package/dist/kit/coords.d.mts +88 -0
- package/dist/kit/coords.mjs +192 -0
- package/dist/kit/data-scene.d.mts +27 -0
- package/dist/kit/data-scene.mjs +199 -0
- package/dist/kit/diagram.mjs +111 -50
- package/dist/kit/electronics.mjs +552 -60
- package/dist/kit/expr-analysis.d.mts +18 -6
- package/dist/kit/expr-analysis.mjs +82 -28
- package/dist/kit/frame.d.mts +3 -3
- package/dist/kit/frame.mjs +25 -6
- package/dist/kit/gameshow.mjs +2 -2
- package/dist/kit/index.d.mts +14 -2
- package/dist/kit/index.mjs +13 -1
- package/dist/kit/logic-gates.mjs +246 -47
- package/dist/kit/palette.mjs +26 -0
- package/dist/kit/pedagogy.d.mts +4 -4
- package/dist/kit/pedagogy.mjs +21 -17
- package/dist/kit/play.d.mts +1 -1
- package/dist/kit/play.mjs +3 -3
- package/dist/kit/predict.d.mts +55 -0
- package/dist/kit/predict.mjs +146 -0
- package/dist/kit/receipt.d.mts +29 -0
- package/dist/kit/receipt.mjs +94 -0
- package/dist/kit/rich.mjs +2 -2
- package/dist/kit/rule.d.mts +59 -0
- package/dist/kit/rule.mjs +215 -0
- package/dist/kit/scale.mjs +1 -1
- package/dist/kit/scene-library.d.mts +22 -0
- package/dist/kit/scene-library.mjs +311 -0
- package/dist/kit/scene-studio.d.mts +14 -0
- package/dist/kit/scene-studio.mjs +338 -0
- package/dist/kit/scenes.d.mts +31 -0
- package/dist/kit/scenes.mjs +569 -0
- package/dist/kit/slot-fill.d.mts +61 -0
- package/dist/kit/slot-fill.mjs +207 -0
- package/dist/kit/solve.d.mts +21 -0
- package/dist/kit/solve.mjs +75 -0
- package/dist/kit/space.mjs +5 -5
- package/dist/kit/steps.mjs +2 -2
- package/dist/kit/vessel.d.mts +69 -0
- package/dist/kit/vessel.mjs +191 -0
- package/dist/language/agreement/preset.mjs +2 -2
- package/dist/language/article-lens/preset.d.mts +1 -1
- package/dist/language/article-lens/preset.mjs +8 -8
- package/dist/language/deck.d.mts +3 -3
- package/dist/language/deck.mjs +1 -1
- package/dist/language/preposition-scene/preset.d.mts +2 -2
- package/dist/language/preposition-scene/preset.mjs +5 -5
- package/dist/language/sentence-builder/preset.mjs +5 -5
- package/dist/language/transform/preset.d.mts +2 -2
- package/dist/language/transform/preset.mjs +5 -5
- package/dist/language/ui.d.mts +3 -3
- package/dist/language/ui.mjs +4 -4
- package/dist/language/word-match/preset.mjs +3 -3
- package/dist/logic/LogicBuildLab.d.mts +22 -0
- package/dist/logic/LogicBuildLab.mjs +170 -0
- package/dist/logic/LogicEditScene.d.mts +31 -0
- package/dist/logic/LogicEditScene.mjs +276 -0
- package/dist/logic/LogicEditor.d.mts +14 -0
- package/dist/logic/LogicEditor.mjs +413 -0
- package/dist/logic/LogicScene.d.mts +32 -0
- package/dist/logic/LogicScene.mjs +277 -0
- package/dist/logic/contract.d.mts +72 -0
- package/dist/logic/display.d.mts +24 -0
- package/dist/logic/display.mjs +127 -0
- package/dist/logic/edit-ops.d.mts +44 -0
- package/dist/logic/edit-ops.mjs +177 -0
- package/dist/logic/evaluate.d.mts +11 -0
- package/dist/logic/evaluate.mjs +93 -0
- package/dist/logic/gates.d.mts +10 -0
- package/dist/logic/gates.mjs +73 -0
- package/dist/logic/index.d.mts +14 -0
- package/dist/logic/index.mjs +13 -0
- package/dist/logic/lab.d.mts +32 -0
- package/dist/logic/lab.mjs +160 -0
- package/dist/logic/presets.d.mts +12 -0
- package/dist/logic/presets.mjs +241 -0
- package/dist/logic/registry.d.mts +9 -0
- package/dist/logic/registry.mjs +15 -0
- package/dist/math/area-model/preset.mjs +70 -44
- package/dist/math/balance-algebra/preset.mjs +14 -5
- package/dist/math/broken-tree/index.d.mts +1 -0
- package/dist/math/broken-tree/preset.d.mts +26 -0
- package/dist/math/broken-tree/preset.mjs +435 -0
- package/dist/math/circle/index.d.mts +1 -0
- package/dist/math/circle/preset.d.mts +44 -0
- package/dist/math/circle/preset.mjs +198 -0
- package/dist/math/complex/core.d.mts +93 -0
- package/dist/math/complex/core.mjs +239 -0
- package/dist/math/complex/index.d.mts +3 -0
- package/dist/math/complex/preset.d.mts +31 -0
- package/dist/math/complex/preset.mjs +377 -0
- package/dist/math/complex/rules.d.mts +6 -0
- package/dist/math/complex/rules.mjs +121 -0
- package/dist/math/conic/index.d.mts +1 -0
- package/dist/math/conic/preset.d.mts +30 -0
- package/dist/math/conic/preset.mjs +334 -0
- package/dist/math/derivation.mjs +5 -5
- package/dist/math/derivative-explorer/preset.mjs +5 -5
- package/dist/math/domain-range/index.d.mts +1 -0
- package/dist/math/domain-range/preset.d.mts +33 -0
- package/dist/math/domain-range/preset.mjs +313 -0
- package/dist/math/fraction-bar/index.d.mts +1 -0
- package/dist/math/fraction-bar/preset.d.mts +27 -0
- package/dist/math/fraction-bar/preset.mjs +197 -0
- package/dist/math/function-machine/preset.mjs +2 -2
- package/dist/math/gradient-descent.mjs +6 -6
- package/dist/math/grapher/preset.d.mts +1 -1
- package/dist/math/grapher/preset.mjs +4 -4
- package/dist/math/harmonic-form/preset.mjs +6 -6
- package/dist/math/index.d.mts +27 -2
- package/dist/math/index.mjs +27 -2
- package/dist/math/integral-explorer/preset.mjs +2 -2
- package/dist/math/interactive/preset.mjs +3 -3
- package/dist/math/limit-explorer/preset.mjs +4 -4
- package/dist/math/linear-model/index.d.mts +1 -0
- package/dist/math/linear-model/preset.d.mts +53 -0
- package/dist/math/linear-model/preset.mjs +164 -0
- package/dist/math/linear-system/preset.mjs +4 -4
- package/dist/math/mystery-bucket/preset.mjs +6 -6
- package/dist/math/number-line/preset.mjs +3 -2
- package/dist/math/parabola/preset.mjs +4 -3
- package/dist/math/pattern/preset.mjs +7 -13
- package/dist/math/percent-bar/index.d.mts +1 -0
- package/dist/math/percent-bar/preset.d.mts +37 -0
- package/dist/math/percent-bar/preset.mjs +275 -0
- package/dist/math/poly/core.d.mts +50 -0
- package/dist/math/poly/core.mjs +268 -0
- package/dist/math/poly/index.d.mts +3 -0
- package/dist/math/poly/preset.d.mts +23 -0
- package/dist/math/poly/preset.mjs +141 -0
- package/dist/math/poly/steps.d.mts +10 -0
- package/dist/math/poly/steps.mjs +99 -0
- package/dist/math/rate-machine/index.d.mts +1 -0
- package/dist/math/rate-machine/preset.d.mts +35 -0
- package/dist/math/rate-machine/preset.mjs +281 -0
- package/dist/math/ratio-share/index.d.mts +1 -0
- package/dist/math/ratio-share/preset.d.mts +24 -0
- package/dist/math/ratio-share/preset.mjs +204 -0
- package/dist/math/receipt/index.d.mts +1 -0
- package/dist/math/receipt/preset.d.mts +22 -0
- package/dist/math/receipt/preset.mjs +137 -0
- package/dist/math/sequence-predict/index.d.mts +1 -0
- package/dist/math/sequence-predict/preset.d.mts +34 -0
- package/dist/math/sequence-predict/preset.mjs +130 -0
- package/dist/math/straight-line/index.d.mts +1 -0
- package/dist/math/straight-line/preset.d.mts +37 -0
- package/dist/math/straight-line/preset.mjs +374 -0
- package/dist/math/system-solve/index.d.mts +1 -0
- package/dist/math/system-solve/preset.d.mts +21 -0
- package/dist/math/system-solve/preset.mjs +227 -0
- package/dist/math/transform/index.d.mts +1 -0
- package/dist/math/transform/preset.d.mts +41 -0
- package/dist/math/transform/preset.mjs +343 -0
- package/dist/math/triangle-trig/preset.mjs +12 -9
- package/dist/math/trig/core.d.mts +37 -0
- package/dist/math/trig/core.mjs +150 -0
- package/dist/math/trig/diagrams.d.mts +1 -0
- package/dist/math/trig/diagrams.mjs +321 -0
- package/dist/math/trig/index.d.mts +3 -0
- package/dist/math/trig/preset.d.mts +25 -0
- package/dist/math/trig/preset.mjs +260 -0
- package/dist/math/trig/rules.d.mts +6 -0
- package/dist/math/trig/rules.mjs +159 -0
- package/dist/math/trig-explorer.mjs +4 -4
- package/dist/ml/boundary/preset.mjs +8 -3
- package/dist/ml/classifier/preset.mjs +31 -6
- package/dist/ml/kmeans/preset.mjs +4 -4
- package/dist/ml/knn/preset.mjs +47 -12
- package/dist/ml/regression/preset.mjs +36 -7
- package/dist/physics/atwood/preset.mjs +4 -4
- package/dist/physics/bullet-walls/preset.d.mts +1 -1
- package/dist/physics/bullet-walls/preset.mjs +7 -7
- package/dist/physics/carnot/preset.mjs +6 -6
- package/dist/physics/circular-motion/preset.mjs +36 -5
- package/dist/physics/collision-track/preset.mjs +35 -5
- package/dist/physics/efficiency/preset.d.mts +2 -2
- package/dist/physics/efficiency/preset.mjs +5 -5
- package/dist/physics/electric-field/preset.mjs +32 -23
- package/dist/physics/electric-flux/index.d.mts +1 -0
- package/dist/physics/electric-flux/preset.d.mts +29 -0
- package/dist/physics/electric-flux/preset.mjs +264 -0
- package/dist/physics/energy-skate/preset.mjs +5 -5
- package/dist/physics/entropy/preset.mjs +7 -7
- package/dist/physics/expansion/preset.mjs +13 -13
- package/dist/physics/exponential/asset.mjs +1 -1
- package/dist/physics/exponential/preset.mjs +4 -4
- package/dist/physics/gas-process/preset.mjs +3 -3
- package/dist/physics/gauss-law/index.d.mts +1 -0
- package/dist/physics/gauss-law/preset.d.mts +20 -0
- package/dist/physics/gauss-law/preset.mjs +286 -0
- package/dist/physics/gravitation/preset.mjs +7 -7
- package/dist/physics/gravity-drop.mjs +4 -4
- package/dist/physics/heat-transfer/preset.d.mts +1 -1
- package/dist/physics/heat-transfer/preset.mjs +10 -10
- package/dist/physics/impulse/preset.mjs +5 -5
- package/dist/physics/index.d.mts +4 -1
- package/dist/physics/index.mjs +4 -1
- package/dist/physics/kepler/preset.mjs +4 -4
- package/dist/physics/lever/preset.mjs +3 -3
- package/dist/physics/lorentz/preset.mjs +11 -11
- package/dist/physics/magnetism/preset.mjs +3 -3
- package/dist/physics/optics/preset.mjs +2 -2
- package/dist/physics/orbit-lab.mjs +5 -5
- package/dist/physics/projectile-lab.mjs +4 -4
- package/dist/physics/rain-relative/preset.mjs +5 -5
- package/dist/physics/ramp-forces/preset.mjs +5 -5
- package/dist/physics/river-boat.mjs +6 -6
- package/dist/physics/shm/preset.mjs +9 -9
- package/dist/physics/stopping-distance/preset.mjs +3 -3
- package/dist/physics/temperature-scales/preset.mjs +105 -116
- package/dist/physics/terminal-velocity/preset.mjs +5 -5
- package/dist/physics/thermal/preset.mjs +5 -5
- package/dist/physics/vector-board/preset.mjs +7 -6
- package/dist/physics/vector-scene.mjs +2 -2
- package/dist/physics/vector-types/preset.mjs +37 -3
- package/dist/physics/water-density/preset.mjs +12 -12
- package/dist/physics/waves/doppler.mjs +2 -2
- package/dist/physics/waves/preset.mjs +4 -4
- package/dist/physics/waves/ripple.mjs +6 -6
- package/dist/physics/waves/string.mjs +5 -5
- package/dist/physics/work-energy/preset.mjs +4 -4
- package/dist/physics/work-potential/index.d.mts +1 -0
- package/dist/physics/work-potential/preset.d.mts +20 -0
- package/dist/physics/work-potential/preset.mjs +276 -0
- package/dist/schemas/index.d.mts +6 -6
- package/dist/schemas/index.mjs +3 -3
- package/dist/statistics/center-spread/preset.mjs +3 -3
- package/dist/statistics/core/descriptive.d.mts +2 -2
- package/dist/statistics/core/descriptive.mjs +2 -2
- package/dist/statistics/core/normal.d.mts +3 -3
- package/dist/statistics/core/normal.mjs +3 -3
- package/dist/statistics/core/sequences.d.mts +1 -1
- package/dist/statistics/galton/preset.mjs +2 -2
- package/dist/statistics/histogram/preset.mjs +6 -6
- package/dist/statistics/normal/preset.mjs +2 -2
- package/dist/statistics/sampling/preset.mjs +4 -4
- package/dist/statistics/sequence/preset.mjs +58 -15
- package/dist/statistics/z-table/preset.mjs +17 -4
- package/package.json +11 -3
- package/styles.css +4 -1
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { StatusPill } from "../../kit/controls.mjs";
|
|
4
|
+
import { ControlBar, LabFrame } from "../../kit/frame.mjs";
|
|
5
|
+
import { useCheckpoint } from "../../kit/pedagogy.mjs";
|
|
6
|
+
import { CoordPlane } from "../../kit/coords.mjs";
|
|
7
|
+
import { I, abs, arg, argDeg, eq, isFiniteC, mul, powInt, rootsOfUnity, toStr } from "./core.mjs";
|
|
8
|
+
import { useEffect, useMemo, useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Circle, Dot, Label, MovableDot, Polyline, Segment } from "@classytic/stage";
|
|
11
|
+
|
|
12
|
+
//#region src/math/complex/preset.tsx
|
|
13
|
+
/**
|
|
14
|
+
* ComplexPlaneLab, the Argand-diagram playground built on the complex kernel. A
|
|
15
|
+
* complex number is a POINT (a + bi) you drag; the lab draws it as a vector from
|
|
16
|
+
* the origin so the SAME (x, y) → (r, θ) story the vector labs teach now reads as
|
|
17
|
+
* "modulus and argument". Modes turn the abstract into the visible:
|
|
18
|
+
* • point , drag z: see a, b, the modulus r = √(a²+b²), and the angle θ in
|
|
19
|
+
* BOTH degrees and radians.
|
|
20
|
+
* • multiply , also plot i·z, the 90° ROTATION that makes i² = −1 obvious
|
|
21
|
+
* (rotate 90° twice = 180° = −1).
|
|
22
|
+
* • power , plot z, z², z³, , De Moivre as a spiral (moduli multiply,
|
|
23
|
+
* angles add).
|
|
24
|
+
* • roots , the n nth-roots of unity equally spaced on the unit circle
|
|
25
|
+
* (n = 4 → 1, i, −1, −i; n = 3 → 1, ω, ω²).
|
|
26
|
+
*/
|
|
27
|
+
const clampNum = (v, lo, hi) => Math.max(lo, Math.min(hi, v));
|
|
28
|
+
const fmt$1 = (n, dp = 2) => {
|
|
29
|
+
const r = Math.round(n * 10 ** dp) / 10 ** dp;
|
|
30
|
+
return (Object.is(r, -0) ? 0 : r).toString().replace(/^-/, "−");
|
|
31
|
+
};
|
|
32
|
+
/** Points along the angle arc from the +Re axis to θ, at radius `r`. */
|
|
33
|
+
function arc(theta, r) {
|
|
34
|
+
const n = 28;
|
|
35
|
+
return Array.from({ length: 29 }, (_, i) => {
|
|
36
|
+
const t = theta * i / n;
|
|
37
|
+
return {
|
|
38
|
+
x: r * Math.cos(t),
|
|
39
|
+
y: r * Math.sin(t)
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const rootLabel = (k, n) => n === 4 ? [
|
|
44
|
+
"1",
|
|
45
|
+
"i",
|
|
46
|
+
"−1",
|
|
47
|
+
"−i"
|
|
48
|
+
][k] : n === 2 ? ["1", "−1"][k] : k === 0 ? "1" : k === 1 ? "ω" : `ω${k === 2 ? "²" : k === 3 ? "³" : "^" + k}`;
|
|
49
|
+
function ComplexPlaneLab(props = {}) {
|
|
50
|
+
const { mode = "point", rootsN = 4, powerN = 3, snap = 1, range = 6, target, height = 380, title = "The complex plane", prompt = mode === "roots" ? "The nth-roots of unity, equally spaced on the unit circle." : mode === "multiply" ? "Drag z. Multiplying by i rotates it 90° — do it twice and you land on −z." : "Drag the point. Read off a + bi, the modulus r, and the angle θ.", activity = "complex-plane" } = props;
|
|
51
|
+
const snapV = (p) => {
|
|
52
|
+
const s = snap > 0 ? {
|
|
53
|
+
x: Math.round(p.x / snap) * snap,
|
|
54
|
+
y: Math.round(p.y / snap) * snap
|
|
55
|
+
} : p;
|
|
56
|
+
return {
|
|
57
|
+
x: clampNum(s.x, -range, range),
|
|
58
|
+
y: clampNum(s.y, -range, range)
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const start0 = () => snapV({
|
|
62
|
+
x: props.start?.re ?? (mode === "roots" ? 0 : 3),
|
|
63
|
+
y: props.start?.im ?? (mode === "roots" ? 0 : 2)
|
|
64
|
+
});
|
|
65
|
+
const [z, setZ] = useState(start0);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
setZ(start0());
|
|
68
|
+
}, [
|
|
69
|
+
props.start?.re,
|
|
70
|
+
props.start?.im,
|
|
71
|
+
mode,
|
|
72
|
+
range
|
|
73
|
+
]);
|
|
74
|
+
const Z = {
|
|
75
|
+
re: z.x,
|
|
76
|
+
im: z.y
|
|
77
|
+
};
|
|
78
|
+
const r = abs(Z);
|
|
79
|
+
const thetaRad = arg(Z);
|
|
80
|
+
const thetaDeg = argDeg(Z);
|
|
81
|
+
const solved = target != null && eq(Z, {
|
|
82
|
+
re: target.re,
|
|
83
|
+
im: target.im
|
|
84
|
+
}, 1e-6);
|
|
85
|
+
useCheckpoint({
|
|
86
|
+
solved,
|
|
87
|
+
activity,
|
|
88
|
+
response: toStr(Z)
|
|
89
|
+
});
|
|
90
|
+
const nRoots = clampNum(Math.round(rootsN), 2, 12);
|
|
91
|
+
const nPow = clampNum(Math.round(powerN), 2, 6);
|
|
92
|
+
const roots = useMemo(() => rootsOfUnity(nRoots), [nRoots]);
|
|
93
|
+
const iz = mul(I, Z);
|
|
94
|
+
const powers = useMemo(() => Array.from({ length: nPow }, (_, k) => powInt(Z, k + 1)), [
|
|
95
|
+
Z.re,
|
|
96
|
+
Z.im,
|
|
97
|
+
nPow
|
|
98
|
+
]);
|
|
99
|
+
const view = {
|
|
100
|
+
xMin: -range,
|
|
101
|
+
xMax: range,
|
|
102
|
+
yMin: -range,
|
|
103
|
+
yMax: range
|
|
104
|
+
};
|
|
105
|
+
const accent = solved ? "var(--stage-good)" : "var(--stage-accent)";
|
|
106
|
+
const figure = /* @__PURE__ */ jsxs(CoordPlane, {
|
|
107
|
+
view,
|
|
108
|
+
height,
|
|
109
|
+
step: mode === "roots" || mode === "multiply" ? 1 : void 0,
|
|
110
|
+
ariaLabel: `Argand plane, z = ${toStr(Z)}`,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsx(Circle, {
|
|
113
|
+
center: {
|
|
114
|
+
x: 0,
|
|
115
|
+
y: 0
|
|
116
|
+
},
|
|
117
|
+
r: 1,
|
|
118
|
+
color: "var(--stage-muted)",
|
|
119
|
+
weight: 1,
|
|
120
|
+
fill: "none",
|
|
121
|
+
opacity: .5
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx(Label, {
|
|
124
|
+
x: range - .3,
|
|
125
|
+
y: 0,
|
|
126
|
+
text: "Re",
|
|
127
|
+
color: "var(--stage-muted)",
|
|
128
|
+
size: 12,
|
|
129
|
+
dy: -10
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx(Label, {
|
|
132
|
+
x: 0,
|
|
133
|
+
y: range - .3,
|
|
134
|
+
text: "Im",
|
|
135
|
+
color: "var(--stage-muted)",
|
|
136
|
+
size: 12,
|
|
137
|
+
dx: 14
|
|
138
|
+
}),
|
|
139
|
+
mode === "roots" && roots.map((w, k) => /* @__PURE__ */ jsxs("g", { children: [
|
|
140
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
141
|
+
from: {
|
|
142
|
+
x: 0,
|
|
143
|
+
y: 0
|
|
144
|
+
},
|
|
145
|
+
to: {
|
|
146
|
+
x: w.re,
|
|
147
|
+
y: w.im
|
|
148
|
+
},
|
|
149
|
+
color: "var(--stage-good)",
|
|
150
|
+
weight: 1.5,
|
|
151
|
+
opacity: .55
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
154
|
+
x: w.re,
|
|
155
|
+
y: w.im,
|
|
156
|
+
r: 5,
|
|
157
|
+
color: "var(--stage-good)"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ jsx(Label, {
|
|
160
|
+
x: w.re,
|
|
161
|
+
y: w.im,
|
|
162
|
+
text: rootLabel(k, nRoots),
|
|
163
|
+
color: "var(--stage-good)",
|
|
164
|
+
size: 13,
|
|
165
|
+
dx: w.re >= 0 ? 12 : -12,
|
|
166
|
+
dy: w.im >= 0 ? -8 : 14,
|
|
167
|
+
anchor: w.re >= 0 ? "start" : "end"
|
|
168
|
+
})
|
|
169
|
+
] }, k)),
|
|
170
|
+
mode === "power" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Polyline, {
|
|
171
|
+
points: [{
|
|
172
|
+
x: 0,
|
|
173
|
+
y: 0
|
|
174
|
+
}, ...powers.filter(isFiniteC).map((p) => ({
|
|
175
|
+
x: p.re,
|
|
176
|
+
y: p.im
|
|
177
|
+
}))],
|
|
178
|
+
color: "var(--stage-accent-2)",
|
|
179
|
+
weight: 1.5,
|
|
180
|
+
opacity: .5,
|
|
181
|
+
dashed: true
|
|
182
|
+
}), powers.map((p, k) => isFiniteC(p) && /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx(Dot, {
|
|
183
|
+
x: p.re,
|
|
184
|
+
y: p.im,
|
|
185
|
+
r: 4,
|
|
186
|
+
color: "var(--stage-accent-2)"
|
|
187
|
+
}), /* @__PURE__ */ jsx(Label, {
|
|
188
|
+
x: p.re,
|
|
189
|
+
y: p.im,
|
|
190
|
+
text: `z${[
|
|
191
|
+
"",
|
|
192
|
+
"²",
|
|
193
|
+
"³",
|
|
194
|
+
"⁴",
|
|
195
|
+
"⁵",
|
|
196
|
+
"⁶"
|
|
197
|
+
][k]}`,
|
|
198
|
+
color: "var(--stage-accent-2)",
|
|
199
|
+
size: 12,
|
|
200
|
+
dy: -10
|
|
201
|
+
})] }, k))] }),
|
|
202
|
+
mode !== "roots" && (z.x !== 0 || z.y !== 0) && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
203
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
204
|
+
from: {
|
|
205
|
+
x: 0,
|
|
206
|
+
y: 0
|
|
207
|
+
},
|
|
208
|
+
to: z,
|
|
209
|
+
color: accent,
|
|
210
|
+
weight: 2.5
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ jsx(Polyline, {
|
|
213
|
+
points: arc(thetaRad, Math.min(.9, r * .45) + .4),
|
|
214
|
+
color: "var(--stage-muted)",
|
|
215
|
+
weight: 1.5
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx(Label, {
|
|
218
|
+
x: Math.cos(thetaRad / 2) * 1.05,
|
|
219
|
+
y: Math.sin(thetaRad / 2) * 1.05,
|
|
220
|
+
text: "θ",
|
|
221
|
+
color: "var(--stage-muted)",
|
|
222
|
+
size: 13
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx(Label, {
|
|
225
|
+
x: z.x / 2,
|
|
226
|
+
y: z.y / 2,
|
|
227
|
+
text: `r=${fmt$1(r)}`,
|
|
228
|
+
color: accent,
|
|
229
|
+
size: 12,
|
|
230
|
+
dx: z.y >= 0 ? 10 : -10,
|
|
231
|
+
dy: z.x >= 0 ? -8 : 14,
|
|
232
|
+
anchor: z.y >= 0 ? "start" : "end"
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
235
|
+
from: z,
|
|
236
|
+
to: {
|
|
237
|
+
x: z.x,
|
|
238
|
+
y: 0
|
|
239
|
+
},
|
|
240
|
+
color: "var(--stage-grid)",
|
|
241
|
+
weight: 1.25,
|
|
242
|
+
dashed: true
|
|
243
|
+
}),
|
|
244
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
245
|
+
from: z,
|
|
246
|
+
to: {
|
|
247
|
+
x: 0,
|
|
248
|
+
y: z.y
|
|
249
|
+
},
|
|
250
|
+
color: "var(--stage-grid)",
|
|
251
|
+
weight: 1.25,
|
|
252
|
+
dashed: true
|
|
253
|
+
})
|
|
254
|
+
] }),
|
|
255
|
+
mode === "multiply" && (z.x !== 0 || z.y !== 0) && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
256
|
+
/* @__PURE__ */ jsx(Segment, {
|
|
257
|
+
from: {
|
|
258
|
+
x: 0,
|
|
259
|
+
y: 0
|
|
260
|
+
},
|
|
261
|
+
to: {
|
|
262
|
+
x: iz.re,
|
|
263
|
+
y: iz.im
|
|
264
|
+
},
|
|
265
|
+
color: "var(--stage-accent-2)",
|
|
266
|
+
weight: 2,
|
|
267
|
+
opacity: .85,
|
|
268
|
+
dashed: true
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ jsx(Dot, {
|
|
271
|
+
x: iz.re,
|
|
272
|
+
y: iz.im,
|
|
273
|
+
r: 6,
|
|
274
|
+
color: "var(--stage-accent-2)"
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ jsx(Label, {
|
|
277
|
+
x: iz.re,
|
|
278
|
+
y: iz.im,
|
|
279
|
+
text: "i·z",
|
|
280
|
+
color: "var(--stage-accent-2)",
|
|
281
|
+
size: 12,
|
|
282
|
+
dy: -12
|
|
283
|
+
})
|
|
284
|
+
] }),
|
|
285
|
+
mode !== "roots" && target != null && !solved && /* @__PURE__ */ jsx(Dot, {
|
|
286
|
+
x: target.re,
|
|
287
|
+
y: target.im,
|
|
288
|
+
r: 9,
|
|
289
|
+
color: "var(--stage-good)",
|
|
290
|
+
opacity: .35
|
|
291
|
+
}),
|
|
292
|
+
mode !== "roots" && /* @__PURE__ */ jsx(MovableDot, {
|
|
293
|
+
value: z,
|
|
294
|
+
onMove: (p) => setZ(snapV(p)),
|
|
295
|
+
snap,
|
|
296
|
+
step: snap || 1,
|
|
297
|
+
color: accent,
|
|
298
|
+
r: 9,
|
|
299
|
+
ariaLabel: "complex number z, drag it"
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
});
|
|
303
|
+
return /* @__PURE__ */ jsx(LabFrame, {
|
|
304
|
+
title,
|
|
305
|
+
prompt,
|
|
306
|
+
controls: mode === "roots" ? /* @__PURE__ */ jsxs(ControlBar, { children: [/* @__PURE__ */ jsxs("span", {
|
|
307
|
+
style: {
|
|
308
|
+
fontWeight: 700,
|
|
309
|
+
fontSize: 15
|
|
310
|
+
},
|
|
311
|
+
children: [
|
|
312
|
+
"z",
|
|
313
|
+
/* @__PURE__ */ jsx("sup", { children: nRoots }),
|
|
314
|
+
" = 1 has ",
|
|
315
|
+
nRoots,
|
|
316
|
+
" roots"
|
|
317
|
+
]
|
|
318
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
319
|
+
style: {
|
|
320
|
+
opacity: .85,
|
|
321
|
+
fontVariantNumeric: "tabular-nums"
|
|
322
|
+
},
|
|
323
|
+
children: [
|
|
324
|
+
"spaced ",
|
|
325
|
+
fmt$1(360 / nRoots, 1),
|
|
326
|
+
"° apart on the unit circle"
|
|
327
|
+
]
|
|
328
|
+
})] }) : /* @__PURE__ */ jsxs(ControlBar, { children: [
|
|
329
|
+
/* @__PURE__ */ jsxs("span", {
|
|
330
|
+
style: {
|
|
331
|
+
fontWeight: 700,
|
|
332
|
+
fontSize: 16,
|
|
333
|
+
fontVariantNumeric: "tabular-nums"
|
|
334
|
+
},
|
|
335
|
+
children: ["z = ", toStr(Z)]
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ jsxs("span", {
|
|
338
|
+
style: {
|
|
339
|
+
opacity: .85,
|
|
340
|
+
fontVariantNumeric: "tabular-nums"
|
|
341
|
+
},
|
|
342
|
+
children: ["|z| = ", fmt$1(r)]
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ jsxs("span", {
|
|
345
|
+
style: {
|
|
346
|
+
opacity: .85,
|
|
347
|
+
fontVariantNumeric: "tabular-nums"
|
|
348
|
+
},
|
|
349
|
+
children: [
|
|
350
|
+
"arg = ",
|
|
351
|
+
fmt$1(thetaDeg, 1),
|
|
352
|
+
"° = ",
|
|
353
|
+
fmt$1(thetaRad),
|
|
354
|
+
" rad"
|
|
355
|
+
]
|
|
356
|
+
}),
|
|
357
|
+
mode === "multiply" && /* @__PURE__ */ jsxs("span", {
|
|
358
|
+
style: { opacity: .85 },
|
|
359
|
+
children: ["i·z = ", toStr(iz)]
|
|
360
|
+
}),
|
|
361
|
+
target != null && /* @__PURE__ */ jsx(StatusPill, {
|
|
362
|
+
ok: solved,
|
|
363
|
+
children: solved ? `✓ ${toStr({
|
|
364
|
+
re: target.re,
|
|
365
|
+
im: target.im
|
|
366
|
+
})}` : `target ${toStr({
|
|
367
|
+
re: target.re,
|
|
368
|
+
im: target.im
|
|
369
|
+
})}`
|
|
370
|
+
})
|
|
371
|
+
] }),
|
|
372
|
+
children: figure
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
//#endregion
|
|
377
|
+
export { ComplexPlaneLab };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { iPow, toTex } from "./core.mjs";
|
|
2
|
+
import { calc, texNum } from "../../kit/calc.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/math/complex/rules.ts
|
|
5
|
+
/**
|
|
6
|
+
* The complex-number RULEBOOK: the core identities as {@link RuleDef} data for the
|
|
7
|
+
* RuleCard concept engine (formula + analogy + a live worked calculator +
|
|
8
|
+
* derivation + tricks). Calculators run on the complex kernel and narrate.
|
|
9
|
+
*/
|
|
10
|
+
const sq = (x) => x < 0 ? `(${x})^2` : `${x}^2`;
|
|
11
|
+
/** |z| = √(a²+b²), with the working. */
|
|
12
|
+
function explainModulus(a, b) {
|
|
13
|
+
const v = Math.hypot(a, b);
|
|
14
|
+
return calc().step(`|z| = \\sqrt{a^2 + b^2} = \\sqrt{${sq(a)} + ${sq(b)}}`, "the distance of z from the origin").step(`= \\sqrt{${a * a + b * b}}`).step(`= ${texNum(Math.round(v * 100) / 100)}`).done(v);
|
|
15
|
+
}
|
|
16
|
+
/** iⁿ via the exact 4-cycle, with the working. */
|
|
17
|
+
function explainIPow(n) {
|
|
18
|
+
const m = (Math.trunc(n) % 4 + 4) % 4;
|
|
19
|
+
const z = iPow(n);
|
|
20
|
+
return calc().step(`i^{${n}} = i^{(${n} \\bmod 4)} = i^{${m}}`, "powers of i repeat every 4").step(`= ${toTex(z)}`, [
|
|
21
|
+
"1",
|
|
22
|
+
"i",
|
|
23
|
+
"-1",
|
|
24
|
+
"-i"
|
|
25
|
+
][m]).done(0);
|
|
26
|
+
}
|
|
27
|
+
const I_POWER_RULE = {
|
|
28
|
+
id: "i-powers",
|
|
29
|
+
name: "Powers of i (the 4-cycle)",
|
|
30
|
+
formula: "i^2 = -1, \\quad i^{n} = i^{\\,n \\bmod 4}",
|
|
31
|
+
analogy: "i is a quarter-turn. i² is two quarter-turns = a half-turn = −1. Four turns is back to 1.",
|
|
32
|
+
inputs: [{
|
|
33
|
+
key: "n",
|
|
34
|
+
label: "n",
|
|
35
|
+
default: 5,
|
|
36
|
+
min: 0,
|
|
37
|
+
max: 24
|
|
38
|
+
}],
|
|
39
|
+
compute: (v) => explainIPow(v.n ?? 0),
|
|
40
|
+
derivation: [
|
|
41
|
+
{
|
|
42
|
+
tex: "i = \\text{rotate } 90^\\circ",
|
|
43
|
+
note: "i lives at a quarter-turn on the unit circle"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
tex: "i^2 = \\text{rotate } 180^\\circ = -1",
|
|
47
|
+
note: "two quarter-turns"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
tex: "i^3 = -i, \\quad i^4 = 1",
|
|
51
|
+
note: "three and four turns"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
tex: "\\Rightarrow i^n \\text{ depends only on } n \\bmod 4",
|
|
55
|
+
note: "the cycle 1, i, −1, −i"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
tricks: [
|
|
59
|
+
"The cycle is 1, i, −1, −i, then it repeats.",
|
|
60
|
+
"So i¹⁰² = i^(102 mod 4) = i² = −1.",
|
|
61
|
+
"\"Multiply by i\" = rotate 90° anticlockwise; \"× −1\" = rotate 180°."
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
const MODULUS_RULE = {
|
|
65
|
+
id: "modulus",
|
|
66
|
+
name: "Modulus |z| = √(a²+b²)",
|
|
67
|
+
formula: "|z| = |a + bi| = \\sqrt{a^2 + b^2}",
|
|
68
|
+
analogy: "The straight-line distance from 0 to the point (a, b) — exactly the length of the z vector (Pythagoras).",
|
|
69
|
+
inputs: [{
|
|
70
|
+
key: "a",
|
|
71
|
+
label: "a (real)",
|
|
72
|
+
default: 3,
|
|
73
|
+
min: -12,
|
|
74
|
+
max: 12
|
|
75
|
+
}, {
|
|
76
|
+
key: "b",
|
|
77
|
+
label: "b (imag)",
|
|
78
|
+
default: 4,
|
|
79
|
+
min: -12,
|
|
80
|
+
max: 12
|
|
81
|
+
}],
|
|
82
|
+
compute: (v) => explainModulus(v.a ?? 0, v.b ?? 0),
|
|
83
|
+
tricks: [
|
|
84
|
+
"It is the hypotenuse of the a, b right triangle.",
|
|
85
|
+
"|z|² = z · z̄ (a number times its conjugate).",
|
|
86
|
+
"|z₁ z₂| = |z₁| |z₂| (lengths multiply on multiplication)."
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
const DE_MOIVRE_RULE = {
|
|
90
|
+
id: "de-moivre",
|
|
91
|
+
name: "De Moivre — (r∠θ)ⁿ = rⁿ ∠ nθ",
|
|
92
|
+
formula: "\\big(r(\\cos\\theta + i\\sin\\theta)\\big)^{n} = r^{n}\\big(\\cos n\\theta + i\\sin n\\theta\\big)",
|
|
93
|
+
analogy: "To raise to a power: MULTIPLY the lengths and ADD the angles. Squaring squares the modulus and doubles the argument.",
|
|
94
|
+
derivation: [
|
|
95
|
+
{
|
|
96
|
+
tex: "z = r(\\cos\\theta + i\\sin\\theta) = r\\,e^{i\\theta}",
|
|
97
|
+
note: "polar form"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
tex: "z^n = (r\\,e^{i\\theta})^n = r^n e^{i n\\theta}",
|
|
101
|
+
note: "exponents: lengths^n, angles ×n"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
tex: "= r^n(\\cos n\\theta + i\\sin n\\theta)",
|
|
105
|
+
note: "back to rectangular"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
tricks: [
|
|
109
|
+
"Powers SPIRAL: |z|>1 winds outward, |z|<1 inward, |z|=1 stays on the circle.",
|
|
110
|
+
"It turns the n nth-roots into \"split the angle into n equal slices\".",
|
|
111
|
+
"Roots of unity zⁿ = 1 are n points 360°/n apart on the unit circle."
|
|
112
|
+
]
|
|
113
|
+
};
|
|
114
|
+
const COMPLEX_RULES = [
|
|
115
|
+
I_POWER_RULE,
|
|
116
|
+
MODULUS_RULE,
|
|
117
|
+
DE_MOIVRE_RULE
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
export { COMPLEX_RULES };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ConicKind, ConicLab, ConicProps } from "./preset.mjs";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LabAskSpec } from "../../kit/ask.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/math/conic/preset.d.ts
|
|
5
|
+
type ConicKind = 'parabola' | 'ellipse' | 'hyperbola' | 'rectangular';
|
|
6
|
+
interface ConicProps {
|
|
7
|
+
kind?: ConicKind;
|
|
8
|
+
/** parabola: y² = 4a·x. ellipse/hyperbola: a, b are the semi-axes. */
|
|
9
|
+
a?: number;
|
|
10
|
+
b?: number;
|
|
11
|
+
/** rectangular: x·y = c. */
|
|
12
|
+
c?: number;
|
|
13
|
+
showFocusDirectrix?: boolean;
|
|
14
|
+
showAsymptotes?: boolean;
|
|
15
|
+
view?: {
|
|
16
|
+
xMin: number;
|
|
17
|
+
xMax: number;
|
|
18
|
+
yMin: number;
|
|
19
|
+
yMax: number;
|
|
20
|
+
};
|
|
21
|
+
height?: number;
|
|
22
|
+
snap?: number;
|
|
23
|
+
title?: string;
|
|
24
|
+
prompt?: string;
|
|
25
|
+
ask?: LabAskSpec;
|
|
26
|
+
activity?: string;
|
|
27
|
+
}
|
|
28
|
+
declare function ConicLab(props?: ConicProps): ReactNode;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ConicKind, ConicLab, ConicProps };
|