@classytic/stage 0.2.0 → 0.4.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 (458) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -1
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/assets/index.mjs +0 -1
  5. package/dist/atomic/aufbau.d.mts +144 -0
  6. package/dist/atomic/aufbau.mjs +384 -0
  7. package/dist/atomic/elements.d.mts +67 -0
  8. package/dist/atomic/elements.mjs +785 -0
  9. package/dist/atomic/emission.d.mts +112 -0
  10. package/dist/atomic/emission.mjs +179 -0
  11. package/dist/atomic/index.d.mts +8 -0
  12. package/dist/atomic/index.mjs +9 -0
  13. package/dist/atomic/periodic.d.mts +82 -0
  14. package/dist/atomic/periodic.mjs +231 -0
  15. package/dist/atomic/properties.d.mts +100 -0
  16. package/dist/atomic/properties.mjs +574 -0
  17. package/dist/atomic/shells.d.mts +137 -0
  18. package/dist/atomic/shells.mjs +170 -0
  19. package/dist/atomic/trends.d.mts +148 -0
  20. package/dist/atomic/trends.mjs +225 -0
  21. package/dist/builder/Palette.mjs +50 -89
  22. package/dist/builder/SceneBuilder.mjs +15 -73
  23. package/dist/chem/chromatography.d.mts +66 -0
  24. package/dist/chem/chromatography.mjs +63 -0
  25. package/dist/chem/complex.d.mts +114 -0
  26. package/dist/chem/complex.mjs +234 -0
  27. package/dist/chem/cycle.d.mts +75 -0
  28. package/dist/chem/cycle.mjs +145 -0
  29. package/dist/chem/equation.d.mts +86 -0
  30. package/dist/chem/equation.mjs +168 -0
  31. package/dist/chem/formula.d.mts +90 -0
  32. package/dist/chem/formula.mjs +201 -0
  33. package/dist/chem/functional-groups.d.mts +31 -0
  34. package/dist/chem/functional-groups.mjs +187 -0
  35. package/dist/chem/hazard.d.mts +94 -0
  36. package/dist/chem/hazard.mjs +329 -0
  37. package/dist/chem/index.d.mts +34 -33
  38. package/dist/chem/index.mjs +34 -28
  39. package/dist/chem/ionic.d.mts +98 -0
  40. package/dist/chem/ionic.mjs +156 -0
  41. package/dist/chem/layout.d.mts +46 -0
  42. package/dist/chem/layout.mjs +342 -0
  43. package/dist/chem/lewis.d.mts +79 -0
  44. package/dist/chem/lewis.mjs +163 -0
  45. package/dist/chem/molecular-orbital.d.mts +114 -0
  46. package/dist/chem/molecular-orbital.mjs +201 -0
  47. package/dist/chem/molecule.d.mts +154 -0
  48. package/dist/chem/molecule.mjs +282 -0
  49. package/dist/chem/nmr.d.mts +153 -0
  50. package/dist/chem/nmr.mjs +165 -0
  51. package/dist/chem/polymer.d.mts +65 -0
  52. package/dist/chem/polymer.mjs +179 -0
  53. package/dist/chem/redox.d.mts +138 -0
  54. package/dist/chem/redox.mjs +328 -0
  55. package/dist/chem/relations.d.mts +183 -0
  56. package/dist/chem/relations.mjs +299 -0
  57. package/dist/chem/skeleton.d.mts +51 -0
  58. package/dist/chem/skeleton.mjs +186 -0
  59. package/dist/chem/solution.d.mts +116 -0
  60. package/dist/chem/solution.mjs +186 -0
  61. package/dist/chem/species.d.mts +47 -0
  62. package/dist/chem/species.mjs +128 -0
  63. package/dist/chem/stereo.d.mts +108 -0
  64. package/dist/chem/stereo.mjs +286 -0
  65. package/dist/chem/stoichiometry.d.mts +95 -0
  66. package/dist/chem/stoichiometry.mjs +145 -0
  67. package/dist/chem/synthesis.d.mts +113 -0
  68. package/dist/chem/synthesis.mjs +281 -0
  69. package/dist/chem/vsepr.d.mts +80 -0
  70. package/dist/chem/vsepr.mjs +247 -0
  71. package/dist/circuit/ac.d.mts +163 -0
  72. package/dist/circuit/ac.mjs +452 -0
  73. package/dist/circuit/dc.d.mts +92 -0
  74. package/dist/circuit/dc.mjs +333 -0
  75. package/dist/circuit/index.d.mts +5 -92
  76. package/dist/circuit/index.mjs +5 -332
  77. package/dist/circuit/network.d.mts +99 -0
  78. package/dist/circuit/network.mjs +440 -0
  79. package/dist/circuit/topology.d.mts +102 -0
  80. package/dist/circuit/topology.mjs +143 -0
  81. package/dist/colour/absorption.d.mts +79 -0
  82. package/dist/colour/absorption.mjs +137 -0
  83. package/dist/colour/index.d.mts +6 -0
  84. package/dist/colour/index.mjs +7 -0
  85. package/dist/colour/name.d.mts +14 -0
  86. package/dist/colour/name.mjs +76 -0
  87. package/dist/colour/observer.d.mts +31 -0
  88. package/dist/colour/observer.mjs +46 -0
  89. package/dist/colour/spectrum.d.mts +61 -0
  90. package/dist/colour/spectrum.mjs +108 -0
  91. package/dist/colour/srgb.d.mts +49 -0
  92. package/dist/colour/srgb.mjs +108 -0
  93. package/dist/core/constants.d.mts +138 -0
  94. package/dist/core/constants.mjs +139 -0
  95. package/dist/core/index.d.mts +4 -1
  96. package/dist/core/index.mjs +4 -1
  97. package/dist/core/math.d.mts +26 -0
  98. package/dist/core/math.mjs +37 -0
  99. package/dist/core/vec3.d.mts +94 -0
  100. package/dist/core/vec3.mjs +123 -0
  101. package/dist/core/worked.d.mts +35 -0
  102. package/dist/core/worked.mjs +44 -0
  103. package/dist/electro/cell.d.mts +102 -0
  104. package/dist/electro/cell.mjs +170 -0
  105. package/dist/electro/conductivity.d.mts +157 -0
  106. package/dist/electro/conductivity.mjs +156 -0
  107. package/dist/electro/couples.d.mts +114 -0
  108. package/dist/electro/couples.mjs +334 -0
  109. package/dist/electro/electrolysis.d.mts +96 -0
  110. package/dist/electro/electrolysis.mjs +274 -0
  111. package/dist/electro/faraday.d.mts +150 -0
  112. package/dist/electro/faraday.mjs +118 -0
  113. package/dist/electro/index.d.mts +6 -0
  114. package/dist/electro/index.mjs +7 -0
  115. package/dist/finance/accounting/adjustments.d.mts +17 -0
  116. package/dist/finance/accounting/adjustments.mjs +202 -0
  117. package/dist/finance/accounting/analysis.d.mts +8 -0
  118. package/dist/finance/accounting/analysis.mjs +205 -0
  119. package/dist/finance/accounting/clubs.d.mts +21 -0
  120. package/dist/finance/accounting/clubs.mjs +217 -0
  121. package/dist/finance/accounting/company-statements.d.mts +7 -0
  122. package/dist/finance/accounting/company-statements.mjs +150 -0
  123. package/dist/finance/accounting/harness.d.mts +7 -0
  124. package/dist/finance/accounting/harness.mjs +45 -0
  125. package/dist/finance/accounting/index.d.mts +18 -0
  126. package/dist/finance/accounting/index.mjs +18 -0
  127. package/dist/finance/accounting/journalize.d.mts +16 -0
  128. package/dist/finance/accounting/journalize.mjs +128 -0
  129. package/dist/finance/accounting/manufacturing.d.mts +8 -0
  130. package/dist/finance/accounting/manufacturing.mjs +236 -0
  131. package/dist/finance/accounting/partnership.d.mts +7 -0
  132. package/dist/finance/accounting/partnership.mjs +152 -0
  133. package/dist/finance/accounting/period-case.d.mts +6 -0
  134. package/dist/finance/accounting/period-case.mjs +71 -0
  135. package/dist/finance/accounting/post.d.mts +9 -0
  136. package/dist/finance/accounting/post.mjs +84 -0
  137. package/dist/finance/accounting/precision.d.mts +9 -0
  138. package/dist/finance/accounting/precision.mjs +15 -0
  139. package/dist/finance/accounting/rules.d.mts +21 -0
  140. package/dist/finance/accounting/rules.mjs +37 -0
  141. package/dist/finance/accounting/solve.d.mts +28 -0
  142. package/dist/finance/accounting/solve.mjs +92 -0
  143. package/dist/finance/accounting/statements.d.mts +7 -0
  144. package/dist/finance/accounting/statements.mjs +142 -0
  145. package/dist/finance/accounting/types.d.mts +649 -0
  146. package/dist/finance/accounting/validate.d.mts +7 -0
  147. package/dist/finance/accounting/validate.mjs +67 -0
  148. package/dist/finance/accounting/verification.d.mts +24 -0
  149. package/dist/finance/accounting/verification.mjs +386 -0
  150. package/dist/finance/bizsim.d.mts +75 -0
  151. package/dist/finance/bizsim.mjs +296 -0
  152. package/dist/finance/index.d.mts +95 -0
  153. package/dist/finance/index.mjs +145 -0
  154. package/dist/finance/investment-math.d.mts +7 -0
  155. package/dist/finance/investment-math.mjs +18 -0
  156. package/dist/finance/management-accounting/budgeting.d.mts +7 -0
  157. package/dist/finance/management-accounting/budgeting.mjs +189 -0
  158. package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
  159. package/dist/finance/management-accounting/cash-budget.mjs +154 -0
  160. package/dist/finance/management-accounting/costing.d.mts +8 -0
  161. package/dist/finance/management-accounting/costing.mjs +175 -0
  162. package/dist/finance/management-accounting/decisions.d.mts +8 -0
  163. package/dist/finance/management-accounting/decisions.mjs +164 -0
  164. package/dist/finance/management-accounting/index.d.mts +13 -0
  165. package/dist/finance/management-accounting/index.mjs +13 -0
  166. package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
  167. package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
  168. package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
  169. package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
  170. package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
  171. package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
  172. package/dist/finance/management-accounting/management-case.d.mts +8 -0
  173. package/dist/finance/management-accounting/management-case.mjs +91 -0
  174. package/dist/finance/management-accounting/master-budget.d.mts +7 -0
  175. package/dist/finance/management-accounting/master-budget.mjs +137 -0
  176. package/dist/finance/management-accounting/production-costing.d.mts +8 -0
  177. package/dist/finance/management-accounting/production-costing.mjs +214 -0
  178. package/dist/finance/management-accounting/types.d.mts +644 -0
  179. package/dist/finance/management-accounting/variances.d.mts +7 -0
  180. package/dist/finance/management-accounting/variances.mjs +150 -0
  181. package/dist/index.d.mts +9 -8
  182. package/dist/index.mjs +5 -5
  183. package/dist/interaction/MovableDot.mjs +19 -0
  184. package/dist/interaction/useDraggable.mjs +24 -4
  185. package/dist/math/analysis.d.mts +61 -0
  186. package/dist/math/analysis.mjs +187 -0
  187. package/dist/math/answer-check.d.mts +50 -0
  188. package/dist/math/answer-check.mjs +106 -0
  189. package/dist/math/calculus.d.mts +17 -1
  190. package/dist/math/calculus.mjs +365 -2
  191. package/dist/math/complex.d.mts +93 -0
  192. package/dist/math/complex.mjs +239 -0
  193. package/dist/math/expr.d.mts +23 -0
  194. package/dist/math/expr.mjs +36 -0
  195. package/dist/math/index.d.mts +9 -23
  196. package/dist/math/index.mjs +9 -38
  197. package/dist/math/latex.mjs +10 -1
  198. package/dist/math/parse.mjs +1 -1
  199. package/dist/math/poly.d.mts +55 -0
  200. package/dist/math/poly.mjs +273 -0
  201. package/dist/math/rearrange.d.mts +14 -0
  202. package/dist/math/rearrange.mjs +125 -0
  203. package/dist/math/solve.d.mts +21 -0
  204. package/dist/math/solve.mjs +75 -0
  205. package/dist/networking/addressing.d.mts +26 -0
  206. package/dist/networking/addressing.mjs +33 -0
  207. package/dist/networking/cloud/access.d.mts +36 -0
  208. package/dist/networking/cloud/access.mjs +95 -0
  209. package/dist/networking/cloud/containers.d.mts +43 -0
  210. package/dist/networking/cloud/containers.mjs +54 -0
  211. package/dist/networking/cloud/edge.d.mts +17 -0
  212. package/dist/networking/cloud/edge.mjs +31 -0
  213. package/dist/networking/cloud/failure-domains.d.mts +19 -0
  214. package/dist/networking/cloud/failure-domains.mjs +22 -0
  215. package/dist/networking/cloud/geo-routing.d.mts +22 -0
  216. package/dist/networking/cloud/geo-routing.mjs +64 -0
  217. package/dist/networking/cloud/index.d.mts +18 -0
  218. package/dist/networking/cloud/index.mjs +19 -0
  219. package/dist/networking/cloud/inference-reliability.d.mts +30 -0
  220. package/dist/networking/cloud/inference-reliability.mjs +76 -0
  221. package/dist/networking/cloud/inference.d.mts +118 -0
  222. package/dist/networking/cloud/inference.mjs +179 -0
  223. package/dist/networking/cloud/infrastructure.d.mts +45 -0
  224. package/dist/networking/cloud/infrastructure.mjs +96 -0
  225. package/dist/networking/cloud/observability.d.mts +24 -0
  226. package/dist/networking/cloud/observability.mjs +34 -0
  227. package/dist/networking/cloud/orchestration.d.mts +32 -0
  228. package/dist/networking/cloud/orchestration.mjs +38 -0
  229. package/dist/networking/cloud/recovery.d.mts +21 -0
  230. package/dist/networking/cloud/recovery.mjs +27 -0
  231. package/dist/networking/cloud/releases.d.mts +42 -0
  232. package/dist/networking/cloud/releases.mjs +135 -0
  233. package/dist/networking/cloud/scaling.d.mts +25 -0
  234. package/dist/networking/cloud/scaling.mjs +65 -0
  235. package/dist/networking/cloud/secrets.d.mts +39 -0
  236. package/dist/networking/cloud/secrets.mjs +68 -0
  237. package/dist/networking/cloud/server-deployment.d.mts +29 -0
  238. package/dist/networking/cloud/server-deployment.mjs +72 -0
  239. package/dist/networking/cloud/storage.d.mts +16 -0
  240. package/dist/networking/cloud/storage.mjs +58 -0
  241. package/dist/networking/cloud/vpc.d.mts +18 -0
  242. package/dist/networking/cloud/vpc.mjs +100 -0
  243. package/dist/networking/delivery.d.mts +34 -0
  244. package/dist/networking/delivery.mjs +52 -0
  245. package/dist/networking/index.d.mts +47 -0
  246. package/dist/networking/index.mjs +47 -0
  247. package/dist/networking/ipv6.d.mts +28 -0
  248. package/dist/networking/ipv6.mjs +17 -0
  249. package/dist/networking/journeys.d.mts +83 -0
  250. package/dist/networking/journeys.mjs +161 -0
  251. package/dist/networking/models/airtime.d.mts +87 -0
  252. package/dist/networking/models/airtime.mjs +130 -0
  253. package/dist/networking/models/cellular.d.mts +157 -0
  254. package/dist/networking/models/cellular.mjs +252 -0
  255. package/dist/networking/models/encapsulation.d.mts +98 -0
  256. package/dist/networking/models/encapsulation.mjs +132 -0
  257. package/dist/networking/models/handover.d.mts +116 -0
  258. package/dist/networking/models/handover.mjs +209 -0
  259. package/dist/networking/models/handshake.d.mts +90 -0
  260. package/dist/networking/models/handshake.mjs +122 -0
  261. package/dist/networking/models/index.d.mts +14 -0
  262. package/dist/networking/models/index.mjs +15 -0
  263. package/dist/networking/models/media.d.mts +82 -0
  264. package/dist/networking/models/media.mjs +188 -0
  265. package/dist/networking/models/satellite.d.mts +86 -0
  266. package/dist/networking/models/satellite.mjs +121 -0
  267. package/dist/networking/models/spectrum.d.mts +83 -0
  268. package/dist/networking/models/spectrum.mjs +235 -0
  269. package/dist/networking/models/switch.d.mts +80 -0
  270. package/dist/networking/models/switch.mjs +155 -0
  271. package/dist/networking/models/vlan.d.mts +62 -0
  272. package/dist/networking/models/vlan.mjs +100 -0
  273. package/dist/networking/models/vpn.d.mts +66 -0
  274. package/dist/networking/models/vpn.mjs +125 -0
  275. package/dist/networking/models/wifi-privacy.d.mts +82 -0
  276. package/dist/networking/models/wifi-privacy.mjs +130 -0
  277. package/dist/networking/models/wifi.d.mts +240 -0
  278. package/dist/networking/models/wifi.mjs +562 -0
  279. package/dist/networking/nat-traversal.d.mts +24 -0
  280. package/dist/networking/nat-traversal.mjs +38 -0
  281. package/dist/networking/protocols.d.mts +17 -0
  282. package/dist/networking/protocols.mjs +57 -0
  283. package/dist/networking/queue.d.mts +12 -0
  284. package/dist/networking/queue.mjs +18 -0
  285. package/dist/networking/route-learning.d.mts +23 -0
  286. package/dist/networking/route-learning.mjs +43 -0
  287. package/dist/networking/routing.d.mts +11 -0
  288. package/dist/networking/routing.mjs +25 -0
  289. package/dist/networking/signals.d.mts +26 -0
  290. package/dist/networking/signals.mjs +35 -0
  291. package/dist/networking/subnet.d.mts +49 -0
  292. package/dist/networking/subnet.mjs +89 -0
  293. package/dist/networking/tcp-reliability.d.mts +24 -0
  294. package/dist/networking/tcp-reliability.mjs +38 -0
  295. package/dist/networking/topology/contract.d.mts +123 -0
  296. package/dist/networking/topology/index.d.mts +4 -0
  297. package/dist/networking/topology/index.mjs +4 -0
  298. package/dist/networking/topology/presets.d.mts +7 -0
  299. package/dist/networking/topology/presets.mjs +302 -0
  300. package/dist/networking/topology/simulation.d.mts +8 -0
  301. package/dist/networking/topology/simulation.mjs +179 -0
  302. package/dist/networking/wireless.d.mts +11 -0
  303. package/dist/networking/wireless.mjs +17 -0
  304. package/dist/optics/imaging.d.mts +218 -0
  305. package/dist/optics/imaging.mjs +276 -0
  306. package/dist/optics/index.d.mts +7 -0
  307. package/dist/optics/index.mjs +8 -0
  308. package/dist/optics/laws.d.mts +70 -0
  309. package/dist/optics/laws.mjs +195 -0
  310. package/dist/optics/prism.d.mts +148 -0
  311. package/dist/optics/prism.mjs +197 -0
  312. package/dist/optics/refraction.d.mts +201 -0
  313. package/dist/optics/refraction.mjs +270 -0
  314. package/dist/optics/wave-optics.d.mts +171 -0
  315. package/dist/optics/wave-optics.mjs +259 -0
  316. package/dist/physics/ac/index.d.mts +183 -0
  317. package/dist/physics/ac/index.mjs +203 -0
  318. package/dist/physics/dynamics/forces.d.mts +98 -0
  319. package/dist/physics/dynamics/forces.mjs +153 -0
  320. package/dist/physics/dynamics/friction.d.mts +76 -0
  321. package/dist/physics/dynamics/friction.mjs +119 -0
  322. package/dist/physics/dynamics/system.d.mts +68 -0
  323. package/dist/physics/dynamics/system.mjs +125 -0
  324. package/dist/physics/electrostatics/index.d.mts +169 -0
  325. package/dist/physics/electrostatics/index.mjs +249 -0
  326. package/dist/physics/energy/centre-of-mass.d.mts +115 -0
  327. package/dist/physics/energy/centre-of-mass.mjs +180 -0
  328. package/dist/physics/energy/conservation.d.mts +81 -0
  329. package/dist/physics/energy/conservation.mjs +129 -0
  330. package/dist/physics/energy/power.d.mts +90 -0
  331. package/dist/physics/energy/power.mjs +167 -0
  332. package/dist/physics/energy/spring.d.mts +73 -0
  333. package/dist/physics/energy/spring.mjs +129 -0
  334. package/dist/physics/energy/store.d.mts +63 -0
  335. package/dist/physics/energy/store.mjs +108 -0
  336. package/dist/physics/energy/theorem.d.mts +65 -0
  337. package/dist/physics/energy/theorem.mjs +113 -0
  338. package/dist/physics/energy/work.d.mts +114 -0
  339. package/dist/physics/energy/work.mjs +219 -0
  340. package/dist/physics/gravitation/body.d.mts +85 -0
  341. package/dist/physics/gravitation/body.mjs +168 -0
  342. package/dist/physics/gravitation/kepler.d.mts +127 -0
  343. package/dist/physics/gravitation/kepler.mjs +216 -0
  344. package/dist/physics/gravitation/law.d.mts +117 -0
  345. package/dist/physics/gravitation/law.mjs +175 -0
  346. package/dist/physics/gravitation/orbit.d.mts +119 -0
  347. package/dist/physics/gravitation/orbit.mjs +202 -0
  348. package/dist/physics/gravitation/potential.d.mts +114 -0
  349. package/dist/physics/gravitation/potential.mjs +202 -0
  350. package/dist/physics/gravitation/variation.d.mts +97 -0
  351. package/dist/physics/gravitation/variation.mjs +175 -0
  352. package/dist/physics/index.d.mts +35 -0
  353. package/dist/physics/index.mjs +36 -0
  354. package/dist/physics/integral-sweep.d.mts +63 -0
  355. package/dist/physics/integral-sweep.mjs +126 -0
  356. package/dist/physics/kinematics/equations.d.mts +47 -0
  357. package/dist/physics/kinematics/equations.mjs +126 -0
  358. package/dist/physics/kinematics/free-fall.d.mts +53 -0
  359. package/dist/physics/kinematics/free-fall.mjs +71 -0
  360. package/dist/physics/kinematics/given.d.mts +16 -0
  361. package/dist/physics/kinematics/given.mjs +55 -0
  362. package/dist/physics/kinematics/roots.d.mts +41 -0
  363. package/dist/physics/kinematics/roots.mjs +72 -0
  364. package/dist/physics/kinematics/solve.d.mts +52 -0
  365. package/dist/physics/kinematics/solve.mjs +172 -0
  366. package/dist/physics/magnetism/biot-savart.d.mts +161 -0
  367. package/dist/physics/magnetism/biot-savart.mjs +353 -0
  368. package/dist/physics/magnetism/flux.d.mts +94 -0
  369. package/dist/physics/magnetism/flux.mjs +313 -0
  370. package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
  371. package/dist/physics/magnetism/geomagnetism.mjs +184 -0
  372. package/dist/physics/magnetism/index.d.mts +12 -0
  373. package/dist/physics/magnetism/index.mjs +74 -0
  374. package/dist/physics/magnetism/lorentz.d.mts +28 -0
  375. package/dist/physics/magnetism/lorentz.mjs +88 -0
  376. package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
  377. package/dist/physics/magnetism/magnetic-force.mjs +169 -0
  378. package/dist/physics/momentum/collide.d.mts +77 -0
  379. package/dist/physics/momentum/collide.mjs +115 -0
  380. package/dist/physics/momentum/impulse.d.mts +89 -0
  381. package/dist/physics/momentum/impulse.mjs +159 -0
  382. package/dist/physics/momentum/planar.d.mts +60 -0
  383. package/dist/physics/momentum/planar.mjs +110 -0
  384. package/dist/physics/projectile.d.mts +107 -0
  385. package/dist/physics/projectile.mjs +185 -0
  386. package/dist/physics/rotation/angular.d.mts +85 -0
  387. package/dist/physics/rotation/angular.mjs +130 -0
  388. package/dist/physics/rotation/circular.d.mts +79 -0
  389. package/dist/physics/rotation/circular.mjs +131 -0
  390. package/dist/physics/rotation/inertia.d.mts +164 -0
  391. package/dist/physics/rotation/inertia.mjs +332 -0
  392. package/dist/physics/rotation/torque.d.mts +65 -0
  393. package/dist/physics/rotation/torque.mjs +134 -0
  394. package/dist/physics/vectors.d.mts +64 -0
  395. package/dist/physics/vectors.mjs +114 -0
  396. package/dist/primitives/Dot.d.mts +2 -15
  397. package/dist/primitives/Dot.mjs +6 -4
  398. package/dist/primitives/Grid.d.mts +33 -17
  399. package/dist/primitives/Grid.mjs +89 -17
  400. package/dist/primitives/Label.d.mts +1 -14
  401. package/dist/primitives/Label.mjs +3 -2
  402. package/dist/primitives/Lines.d.mts +4 -32
  403. package/dist/primitives/Lines.mjs +10 -8
  404. package/dist/primitives/Shapes.d.mts +5 -43
  405. package/dist/primitives/Shapes.mjs +12 -10
  406. package/dist/primitives/index.d.mts +2 -2
  407. package/dist/primitives/index.mjs +2 -2
  408. package/dist/primitives/props.mjs +31 -0
  409. package/dist/quantity/index.d.mts +119 -0
  410. package/dist/quantity/index.mjs +417 -0
  411. package/dist/relation/derive.d.mts +74 -0
  412. package/dist/relation/derive.mjs +73 -0
  413. package/dist/relation/index.d.mts +56 -0
  414. package/dist/relation/index.mjs +234 -0
  415. package/dist/scene/Scene.d.mts +6 -1
  416. package/dist/scene/Scene.mjs +15 -40
  417. package/dist/scene/evaluators.mjs +1 -1
  418. package/dist/sim/thermal.mjs +45 -20
  419. package/dist/thermo/calorimetry.d.mts +207 -0
  420. package/dist/thermo/calorimetry.mjs +345 -0
  421. package/dist/thermo/cycles.d.mts +142 -0
  422. package/dist/thermo/cycles.mjs +256 -0
  423. package/dist/thermo/entropy.d.mts +87 -0
  424. package/dist/thermo/entropy.mjs +140 -0
  425. package/dist/thermo/expansion.d.mts +130 -0
  426. package/dist/thermo/expansion.mjs +178 -0
  427. package/dist/thermo/gas.d.mts +197 -0
  428. package/dist/thermo/gas.mjs +279 -0
  429. package/dist/thermo/heat-transfer.d.mts +164 -0
  430. package/dist/thermo/heat-transfer.mjs +217 -0
  431. package/dist/thermo/index.d.mts +9 -82
  432. package/dist/thermo/index.mjs +9 -132
  433. package/dist/thermo/processes.d.mts +95 -0
  434. package/dist/thermo/processes.mjs +154 -0
  435. package/dist/thermo/temperature.d.mts +174 -0
  436. package/dist/thermo/temperature.mjs +236 -0
  437. package/dist/view/Stage.mjs +4 -11
  438. package/dist/waves/damping.d.mts +224 -0
  439. package/dist/waves/damping.mjs +317 -0
  440. package/dist/waves/doppler.d.mts +72 -0
  441. package/dist/waves/doppler.mjs +125 -0
  442. package/dist/waves/index.d.mts +10 -0
  443. package/dist/waves/index.mjs +10 -0
  444. package/dist/waves/pendulum.d.mts +130 -0
  445. package/dist/waves/pendulum.mjs +211 -0
  446. package/dist/waves/pitch.d.mts +125 -0
  447. package/dist/waves/pitch.mjs +158 -0
  448. package/dist/waves/shm.d.mts +170 -0
  449. package/dist/waves/shm.mjs +279 -0
  450. package/dist/waves/springs.d.mts +103 -0
  451. package/dist/waves/springs.mjs +176 -0
  452. package/dist/waves/superposition.d.mts +124 -0
  453. package/dist/waves/superposition.mjs +196 -0
  454. package/dist/waves/wave.d.mts +154 -0
  455. package/dist/waves/wave.mjs +178 -0
  456. package/package.json +103 -23
  457. package/styles.css +125 -8
  458. package/dist/assets/kit/index.mjs +0 -4
@@ -0,0 +1,328 @@
1
+ //#region src/chem/redox.ts
2
+ /** Parse `'Cr2O7^2-'` into its element counts and charge. See the docblock on the caret rule. */
3
+ function parseSpecies(input) {
4
+ const formula = input.trim();
5
+ if (!formula) throw new Error("Empty species");
6
+ let body = formula;
7
+ let charge = 0;
8
+ const caret = body.lastIndexOf("^");
9
+ if (caret >= 0) {
10
+ const tail = body.slice(caret + 1);
11
+ const m = /^(\d*)([+-])$/.exec(tail);
12
+ if (!m) throw new Error(`Cannot read the charge "${tail}" in "${formula}". Write it as ^2- or ^3+.`);
13
+ charge = (m[1] ? Number(m[1]) : 1) * (m[2] === "+" ? 1 : -1);
14
+ body = body.slice(0, caret);
15
+ } else {
16
+ const m = /([+-])$/.exec(body);
17
+ if (m) {
18
+ charge = m[1] === "+" ? 1 : -1;
19
+ body = body.slice(0, body.length - 1);
20
+ if (/^[A-Z][a-z]?\d+$/.test(body)) {
21
+ const split = /^([A-Z][a-z]?)(\d+)$/.exec(body);
22
+ throw new Error(`"${formula}" is ambiguous: the ${split[2]} could be a subscript or the charge. Write it as "${split[1]}^${split[2]}${m[1]}".`);
23
+ }
24
+ }
25
+ }
26
+ const elements = {};
27
+ const add = (symbol, n) => {
28
+ elements[symbol] = (elements[symbol] ?? 0) + n;
29
+ };
30
+ const walk = (text, multiplier) => {
31
+ let i = 0;
32
+ while (i < text.length) {
33
+ if (text[i] === "(") {
34
+ let depth = 1;
35
+ let j = i + 1;
36
+ while (j < text.length && depth > 0) {
37
+ if (text[j] === "(") depth++;
38
+ if (text[j] === ")") depth--;
39
+ j++;
40
+ }
41
+ if (depth !== 0) throw new Error(`Unclosed bracket in "${formula}"`);
42
+ const inner = text.slice(i + 1, j - 1);
43
+ const digits = /^\d+/.exec(text.slice(j));
44
+ walk(inner, multiplier * (digits ? Number(digits[0]) : 1));
45
+ i = j + (digits ? digits[0].length : 0);
46
+ continue;
47
+ }
48
+ const sym = /^[A-Z][a-z]?/.exec(text.slice(i));
49
+ if (!sym) throw new Error(`Cannot read "${text.slice(i)}" in "${formula}"`);
50
+ i += sym[0].length;
51
+ const digits = /^\d+/.exec(text.slice(i));
52
+ const count = digits ? Number(digits[0]) : 1;
53
+ i += digits ? digits[0].length : 0;
54
+ add(sym[0], count * multiplier);
55
+ }
56
+ };
57
+ walk(body, 1);
58
+ return {
59
+ formula,
60
+ elements,
61
+ charge
62
+ };
63
+ }
64
+ const ALWAYS = {
65
+ F: -1,
66
+ Li: 1,
67
+ Na: 1,
68
+ K: 1,
69
+ Rb: 1,
70
+ Cs: 1,
71
+ Be: 2,
72
+ Mg: 2,
73
+ Ca: 2,
74
+ Sr: 2,
75
+ Ba: 2
76
+ };
77
+ /**
78
+ * Oxidation number of every element in a species.
79
+ *
80
+ * `peroxide` forces O to −1, for H₂O₂ and its salts. It is an argument rather than a detection
81
+ * rule, because H₂O₂ and H₂O differ only in a subscript and guessing from the formula would make
82
+ * the kernel wrong in exactly the case the syllabus asks about.
83
+ */
84
+ function oxidationNumbers(input, opts = {}) {
85
+ const species = typeof input === "string" ? parseSpecies(input) : input;
86
+ const symbols = Object.keys(species.elements);
87
+ if (symbols.length === 1 && species.charge === 0) return { [symbols[0]]: 0 };
88
+ if (symbols.length === 1 && species.elements[symbols[0]] === 1) return { [symbols[0]]: species.charge };
89
+ const known = {};
90
+ const unknown = [];
91
+ for (const symbol of symbols) if (symbol in ALWAYS) known[symbol] = ALWAYS[symbol];
92
+ else if (symbol === "O") known.O = opts.peroxide ? -1 : -2;
93
+ else if (symbol === "H") known.H = opts.hydride ? -1 : 1;
94
+ else unknown.push(symbol);
95
+ if (unknown.length === 0) return known;
96
+ if (unknown.length > 1) throw new Error(`"${species.formula}" has ${unknown.length} elements with no fixed oxidation number (${unknown.join(", ")}), so none of them is determined. Split the species or state one.`);
97
+ const target = unknown[0];
98
+ let sum = 0;
99
+ for (const [symbol, value] of Object.entries(known)) sum += value * species.elements[symbol];
100
+ known[target] = (species.charge - sum) / species.elements[target];
101
+ return known;
102
+ }
103
+ const SUPER = {
104
+ "0": "⁰",
105
+ "1": "¹",
106
+ "2": "²",
107
+ "3": "³",
108
+ "4": "⁴",
109
+ "5": "⁵",
110
+ "6": "⁶",
111
+ "7": "⁷",
112
+ "8": "⁸",
113
+ "9": "⁹",
114
+ "+": "⁺",
115
+ "-": "⁻"
116
+ };
117
+ const SUB = {
118
+ "0": "₀",
119
+ "1": "₁",
120
+ "2": "₂",
121
+ "3": "₃",
122
+ "4": "₄",
123
+ "5": "₅",
124
+ "6": "₆",
125
+ "7": "₇",
126
+ "8": "₈",
127
+ "9": "₉"
128
+ };
129
+ /**
130
+ * `'Cr2O7^2-'` → `'Cr₂O₇²⁻'`, for display.
131
+ *
132
+ * The caret is an input convention forced by ASCII ambiguity, and a learner should never see it.
133
+ *
134
+ * ## The one place the caret is not needed
135
+ *
136
+ * After a closing bracket. `[Cu(H2O)6]2+` has no ambiguity at all, because a digit cannot be the
137
+ * subscript of a `]`, and that is the form `complexFormula` emits. Without this case a complex ion
138
+ * came back as `[Cu(H₂O)₆]₂⁺`, with its charge written as a subscript: the same class of defect as a
139
+ * formatter producing a string its sibling parser cannot read.
140
+ */
141
+ function speciesToUnicode(formula) {
142
+ const bracketed = /^(.*\])(\d+)([+-])$/.exec(formula);
143
+ if (bracketed) return bracketed[1].replace(/\d/g, (d) => SUB[d]) + ([...bracketed[2]].map((d) => SUPER[d]).join("") + SUPER[bracketed[3]]);
144
+ const caret = formula.lastIndexOf("^");
145
+ const body = caret >= 0 ? formula.slice(0, caret) : formula.replace(/[+-]+$/, "");
146
+ const tail = caret >= 0 ? formula.slice(caret + 1) : /[+-]+$/.exec(formula)?.[0] ?? "";
147
+ return body.replace(/\d/g, (d) => SUB[d]) + [...tail].map((c) => SUPER[c] ?? c).join("");
148
+ }
149
+ /** Positive when oxidised, negative when reduced, for `element` between two species. */
150
+ function oxidationChange(element, from, to) {
151
+ const a = oxidationNumbers(from)[element];
152
+ const b = oxidationNumbers(to)[element];
153
+ if (a === void 0 || b === void 0) throw new Error(`"${element}" is not in both ${from} and ${to}`);
154
+ return b - a;
155
+ }
156
+ const gcd = (a, b) => b === 0 ? Math.abs(a) : gcd(b, a % b);
157
+ const WATER = parseSpecies("H2O");
158
+ const PROTON = parseSpecies("H+");
159
+ const HYDROXIDE = parseSpecies("OH-");
160
+ const term = (coeff, species) => ({
161
+ coeff,
162
+ species
163
+ });
164
+ function countIn(terms, element) {
165
+ return terms.reduce((n, t) => n + t.coeff * (t.species.elements[element] ?? 0), 0);
166
+ }
167
+ const chargeOf = (terms) => terms.reduce((q, t) => q + t.coeff * t.species.charge, 0);
168
+ /**
169
+ * Balance one half-equation, in acid or in alkali.
170
+ *
171
+ * `balanceHalf('MnO4-', 'Mn2+')` → MnO₄⁻ + 8H⁺ + 5e⁻ → Mn²⁺ + 4H₂O.
172
+ *
173
+ * Alkali is not a second procedure: the equation is balanced in acid and then neutralised, which is
174
+ * exactly what a mark scheme wants written.
175
+ */
176
+ function balanceHalf(from, to, medium = "acid") {
177
+ const a = parseSpecies(from);
178
+ const b = parseSpecies(to);
179
+ const key = Object.keys(a.elements).filter((s) => s !== "O" && s !== "H");
180
+ let coeffA = 1;
181
+ let coeffB = 1;
182
+ for (const element of key) {
183
+ const inA = a.elements[element] ?? 0;
184
+ const inB = b.elements[element] ?? 0;
185
+ if (inA === 0 || inB === 0) continue;
186
+ const g = gcd(inA, inB);
187
+ coeffA = Math.max(coeffA, inB / g);
188
+ coeffB = Math.max(coeffB, inA / g);
189
+ }
190
+ let left = [term(coeffA, a)];
191
+ let right = [term(coeffB, b)];
192
+ const dO = countIn(left, "O") - countIn(right, "O");
193
+ if (dO > 0) right.push(term(dO, WATER));
194
+ else if (dO < 0) left.push(term(-dO, WATER));
195
+ const dH = countIn(left, "H") - countIn(right, "H");
196
+ if (dH > 0) right.push(term(dH, PROTON));
197
+ else if (dH < 0) left.push(term(-dH, PROTON));
198
+ const dQ = chargeOf(left) - chargeOf(right);
199
+ const electrons = Math.abs(dQ);
200
+ const electronSide = dQ > 0 ? "left" : "right";
201
+ if (medium === "alkali") {
202
+ const protons = [...left, ...right].find((t) => t.species.formula === "H+");
203
+ if (protons) {
204
+ const n = protons.coeff;
205
+ const protonsOnLeft = left.includes(protons);
206
+ left = left.filter((t) => t !== protons);
207
+ right = right.filter((t) => t !== protons);
208
+ if (protonsOnLeft) {
209
+ left.push(term(n, WATER));
210
+ right.push(term(n, HYDROXIDE));
211
+ } else {
212
+ right.push(term(n, WATER));
213
+ left.push(term(n, HYDROXIDE));
214
+ }
215
+ left = mergeWater(left);
216
+ right = mergeWater(right);
217
+ cancelWater(left, right);
218
+ }
219
+ }
220
+ return {
221
+ left: left.filter((t) => t.coeff > 0),
222
+ right: right.filter((t) => t.coeff > 0),
223
+ electrons,
224
+ electronSide,
225
+ medium
226
+ };
227
+ }
228
+ function mergeWater(terms) {
229
+ const water = terms.filter((t) => t.species.formula === "H2O");
230
+ if (water.length < 2) return terms;
231
+ const total = water.reduce((n, t) => n + t.coeff, 0);
232
+ return [...terms.filter((t) => t.species.formula !== "H2O"), term(total, WATER)];
233
+ }
234
+ /** Water on both sides cancels, which is the tidying step a mark scheme expects. */
235
+ function cancelWater(left, right) {
236
+ const l = left.findIndex((t) => t.species.formula === "H2O");
237
+ const r = right.findIndex((t) => t.species.formula === "H2O");
238
+ if (l < 0 || r < 0) return;
239
+ const shared = Math.min(left[l].coeff, right[r].coeff);
240
+ left[l] = term(left[l].coeff - shared, WATER);
241
+ right[r] = term(right[r].coeff - shared, WATER);
242
+ if (left[l].coeff === 0) left.splice(l, 1);
243
+ const r2 = right.findIndex((t) => t.species.formula === "H2O" && t.coeff === 0);
244
+ if (r2 >= 0) right.splice(r2, 1);
245
+ }
246
+ /**
247
+ * "MnO₄⁻ + 8H⁺ + 5e⁻ → Mn²⁺ + 4H₂O", for display.
248
+ *
249
+ * Built from the TERMS, not by running `speciesToUnicode` over the finished string. That was tried
250
+ * and is wrong: a coefficient is a normal-size number and a separator is a plus sign, so formatting
251
+ * the whole line turns `2Cr^3+ + 7H2O` into subscripted coefficients and superscripted plus signs.
252
+ * Chemistry typography is per-species, so the formatter has to be too.
253
+ */
254
+ function halfToUnicode(half) {
255
+ const side = (terms, withElectrons) => {
256
+ const parts = terms.map((t) => (t.coeff === 1 ? "" : String(t.coeff)) + speciesToUnicode(t.species.formula));
257
+ if (withElectrons && half.electrons > 0) parts.push((half.electrons === 1 ? "" : String(half.electrons)) + "e⁻");
258
+ return parts.join(" + ");
259
+ };
260
+ return `${side(half.left, half.electronSide === "left")} → ${side(half.right, half.electronSide === "right")}`;
261
+ }
262
+ /** "MnO₄⁻ + 8H⁺ + 5Fe²⁺ → Mn²⁺ + 4H₂O + 5Fe³⁺", for display. */
263
+ function ionicToUnicode(equation) {
264
+ const side = (terms) => terms.map((t) => (t.coeff === 1 ? "" : String(t.coeff)) + speciesToUnicode(t.species.formula)).join(" + ");
265
+ return `${side(equation.left)} → ${side(equation.right)}`;
266
+ }
267
+ /** "MnO4- + 8H+ + 5e- -> Mn2+ + 4H2O" */
268
+ function halfToString(half) {
269
+ const side = (terms, withElectrons) => {
270
+ const parts = terms.map((t) => t.coeff === 1 ? t.species.formula : `${t.coeff}${t.species.formula}`);
271
+ if (withElectrons && half.electrons > 0) parts.push(half.electrons === 1 ? "e-" : `${half.electrons}e-`);
272
+ return parts.join(" + ");
273
+ };
274
+ return `${side(half.left, half.electronSide === "left")} -> ${side(half.right, half.electronSide === "right")}`;
275
+ }
276
+ /**
277
+ * Combine a reduction and an oxidation into the full ionic equation.
278
+ *
279
+ * Each half is scaled so the electrons cancel exactly, which is the step the whole topic exists to
280
+ * teach: electrons are not created, so the number lost must equal the number gained.
281
+ */
282
+ function combineHalves(a, b) {
283
+ const reduction = a.electronSide === "left" ? a : b;
284
+ const oxidation = a.electronSide === "left" ? b : a;
285
+ if (reduction.electronSide !== "left" || oxidation.electronSide !== "right") throw new Error("combineHalves needs one reduction and one oxidation, not two of the same.");
286
+ const g = gcd(reduction.electrons, oxidation.electrons) || 1;
287
+ const lcm = reduction.electrons * oxidation.electrons / g;
288
+ const scaleR = lcm / reduction.electrons;
289
+ const scaleO = lcm / oxidation.electrons;
290
+ const scale = (terms, by) => terms.map((t) => term(t.coeff * by, t.species));
291
+ const left = collect([...scale(reduction.left, scaleR), ...scale(oxidation.left, scaleO)]);
292
+ const right = collect([...scale(reduction.right, scaleR), ...scale(oxidation.right, scaleO)]);
293
+ cancelCommon(left, right);
294
+ return {
295
+ left,
296
+ right,
297
+ transferred: lcm
298
+ };
299
+ }
300
+ function collect(terms) {
301
+ const out = [];
302
+ for (const t of terms) {
303
+ const found = out.findIndex((u) => u.species.formula === t.species.formula);
304
+ if (found >= 0) out[found] = term(out[found].coeff + t.coeff, t.species);
305
+ else out.push(t);
306
+ }
307
+ return out;
308
+ }
309
+ /** A species on both sides is a spectator of the combination and is cancelled. */
310
+ function cancelCommon(left, right) {
311
+ for (let i = left.length - 1; i >= 0; i--) {
312
+ const j = right.findIndex((t) => t.species.formula === left[i].species.formula);
313
+ if (j < 0) continue;
314
+ const shared = Math.min(left[i].coeff, right[j].coeff);
315
+ left[i] = term(left[i].coeff - shared, left[i].species);
316
+ right[j] = term(right[j].coeff - shared, right[j].species);
317
+ if (right[j].coeff === 0) right.splice(j, 1);
318
+ if (left[i].coeff === 0) left.splice(i, 1);
319
+ }
320
+ }
321
+ /** "2MnO4- + 16H+ + 10Fe2+ -> 2Mn2+ + 8H2O + 10Fe3+" */
322
+ function ionicToString(equation) {
323
+ const side = (terms) => terms.map((t) => t.coeff === 1 ? t.species.formula : `${t.coeff}${t.species.formula}`).join(" + ");
324
+ return `${side(equation.left)} -> ${side(equation.right)}`;
325
+ }
326
+
327
+ //#endregion
328
+ export { balanceHalf, combineHalves, halfToString, halfToUnicode, ionicToString, ionicToUnicode, oxidationChange, oxidationNumbers, parseSpecies, speciesToUnicode };
@@ -0,0 +1,183 @@
1
+ import { Relation } from "../relation/index.mjs";
2
+
3
+ //#region src/chem/relations.d.ts
4
+ /** `n = m / M`, moles from a mass weighed out. */
5
+ declare const molesFromMass: () => Relation;
6
+ /** `n = c * V`, moles in a volume of solution. Give V in cm3 and the conversion looks after itself. */
7
+ declare const molesFromSolution: () => Relation;
8
+ /** `n = N / L`, moles from a number of particles. */
9
+ declare const molesFromParticles: () => Relation;
10
+ /**
11
+ * `n = V / Vm`, moles of a gas from its volume at a stated molar volume.
12
+ *
13
+ * The molar volume is a variable rather than a constant baked in, because it is not one: it depends
14
+ * on temperature and pressure, and quoting 22.4 dm3/mol without saying "at standard temperature and
15
+ * pressure" is where a great many wrong answers begin.
16
+ */
17
+ declare const molesFromGasVolume: () => Relation;
18
+ /** `P * V = n * R * T`, the ideal gas equation. Temperature in kelvin, as it must be. */
19
+ declare const idealGas: () => Relation;
20
+ /** `P1 * V1 / T1 = P2 * V2 / T2`, one gas under two sets of conditions. */
21
+ declare const combinedGasLaw: () => Relation;
22
+ /** `c = n / V`, concentration from moles and volume. */
23
+ declare const concentration: () => Relation;
24
+ /**
25
+ * `c1 * V1 = c2 * V2`, dilution.
26
+ *
27
+ * True because the moles do not change when water is added, which is the whole of the derivation
28
+ * and is worth saying every time it is used.
29
+ */
30
+ declare const dilution: () => Relation;
31
+ /** `m_conc = c * V * M`, the mass to weigh out to make up a standard solution. */
32
+ declare const massForSolution: () => Relation;
33
+ /**
34
+ * `b = n / m_solvent`, molality: moles of solute per kilogram of SOLVENT.
35
+ *
36
+ * Not per kilogram of solution, and not per litre of anything. The distinction from molarity is the
37
+ * point of having both: molality uses a mass, so it does not change when the temperature does,
38
+ * which is why it is the one that appears in freezing point and boiling point work.
39
+ */
40
+ declare const molality: () => Relation;
41
+ /** `rho = m / V`, density, which is what converts between a volume and a mass of solution. */
42
+ declare const density: () => Relation;
43
+ /**
44
+ * `A = eps * c * l`, the Beer-Lambert law.
45
+ *
46
+ * Absorbance is dimensionless: it is a logarithm of a ratio of intensities, so it has no unit, and
47
+ * the molar absorptivity carries whatever is needed to cancel the concentration and the path
48
+ * length. Declaring it that way is what lets the units check pass, and it is also the honest
49
+ * description of what absorbance is.
50
+ *
51
+ * Solving it for the concentration is the entire quantitative use of a colorimeter: measure the
52
+ * absorbance of a coloured solution, and read its concentration off.
53
+ */
54
+ declare const beerLambert: () => Relation;
55
+ /**
56
+ * `A = log10(I0 / I)`, absorbance from the light that went in and the light that came out.
57
+ *
58
+ * The definition the law above is built on, and the reason absorbance has no unit.
59
+ */
60
+ declare const absorbanceFromIntensity: () => Relation;
61
+ /** `q = m * c * dT`, the heat a measured temperature change accounts for. */
62
+ declare const heatEnergy: () => Relation;
63
+ /**
64
+ * The values these relations are usually fed, kept as data with their units attached.
65
+ *
66
+ * Passed in rather than compiled into the relations. A molar volume of 24 dm3/mol is only right at
67
+ * room temperature and 22.4 only at standard temperature and pressure, and a relation that hid
68
+ * either inside itself would give a confidently wrong answer under the other conditions.
69
+ */
70
+ declare const CONSTANTS: {
71
+ /** Avogadro constant, per mole. */readonly avogadro: 6.02214076e+23; /** Molar gas constant, J per mole per kelvin. */
72
+ readonly gasConstant: number; /** Molar volume of an ideal gas at 273.15 K and 100 kPa, dm3 per mole. */
73
+ readonly molarVolumeStp: 22.7; /** Molar volume at 298 K and 100 kPa, dm3 per mole: the figure room-temperature questions use. */
74
+ readonly molarVolumeRoom: 24; /** Specific heat capacity of water, J per gram per kelvin. */
75
+ readonly waterHeatCapacity: 4.18;
76
+ };
77
+ /** Kelvin from degrees Celsius. One line, and the source of a great many wrong gas answers. */
78
+ declare const kelvinFrom: (celsius: number) => number;
79
+ /**
80
+ * The derivations, so a lesson can say why a formula is true and not only how to use it.
81
+ *
82
+ * Three kinds, and the difference between them is worth as much as the formulae. A definition has
83
+ * nothing underneath it. A derived relation follows from others plus something held fixed, and the
84
+ * chain is executable, so the claim is checked rather than asserted. A measured one was observed by
85
+ * somebody, and saying so is the difference between teaching chemistry and teaching a formula
86
+ * sheet.
87
+ */
88
+ declare const DERIVATIONS: {
89
+ /**
90
+ * Dilution, the one everyone memorises and nobody can justify.
91
+ *
92
+ * The argument is three sentences long. Adding water changes the volume and changes the
93
+ * concentration, and does not change the number of moles. So `n = cV` holds at both ends with the
94
+ * same n, and that is the rule.
95
+ */
96
+ readonly dilution: {
97
+ readonly kind: "derived";
98
+ readonly summary: "Adding water changes how much there is of the solution and how concentrated it is, and changes nothing about how much solute is in it.";
99
+ readonly invariant: "the number of moles of solute, which water does not create or destroy";
100
+ readonly arrivesAt: "c2";
101
+ readonly steps: readonly [{
102
+ readonly relation: () => Relation;
103
+ readonly solveFor: "n";
104
+ readonly using: {
105
+ readonly c: "c1";
106
+ readonly V: "V1";
107
+ };
108
+ readonly gives: "n";
109
+ readonly because: "first find how many moles the stock solution you measured out actually contains";
110
+ }, {
111
+ readonly relation: () => Relation;
112
+ readonly solveFor: "c";
113
+ readonly using: {
114
+ readonly n: "n";
115
+ readonly V: "V2";
116
+ };
117
+ readonly gives: "c2";
118
+ readonly because: "those same moles are now spread through the larger volume, so the concentration is what they make up in it";
119
+ }];
120
+ };
121
+ /**
122
+ * The mass to weigh out for a standard solution.
123
+ *
124
+ * Two definitions laid end to end, which is worth showing because learners meet it as a third
125
+ * formula rather than as the two they already have.
126
+ */
127
+ readonly massForSolution: {
128
+ readonly kind: "derived";
129
+ readonly summary: "You cannot weigh out moles, so work out how many moles the solution needs and then what that many moles weigh.";
130
+ readonly invariant: "nothing is held fixed here: this is two definitions used one after the other";
131
+ readonly arrivesAt: "m";
132
+ readonly steps: readonly [{
133
+ readonly relation: () => Relation;
134
+ readonly solveFor: "n";
135
+ readonly using: {
136
+ readonly c: "c";
137
+ readonly V: "V";
138
+ };
139
+ readonly gives: "n";
140
+ readonly because: "the volume you are making up, at the concentration you want, needs this many moles";
141
+ }, {
142
+ readonly relation: () => Relation;
143
+ readonly solveFor: "m";
144
+ readonly using: {
145
+ readonly n: "n";
146
+ readonly M: "M";
147
+ };
148
+ readonly gives: "m";
149
+ readonly because: "and that many moles of this substance weigh this much, which is what goes on the balance";
150
+ }];
151
+ };
152
+ readonly concentration: {
153
+ readonly kind: "definition";
154
+ readonly summary: "Concentration is how many moles are dissolved in each unit of volume. That is what the word means.";
155
+ };
156
+ readonly molesFromMass: {
157
+ readonly kind: "definition";
158
+ readonly summary: "Molar mass is defined as the mass of one mole, so dividing a mass by it counts how many moles that mass is.";
159
+ };
160
+ /**
161
+ * The Beer-Lambert law, which is measured and is usually taught as though it were not.
162
+ *
163
+ * It is stated as a formula with no hint that anyone ever checked it, and it does in fact fail:
164
+ * at high concentrations absorbance stops rising in step, which is why a calibration curve is
165
+ * drawn and a sample too dark to read is diluted before it is measured.
166
+ */
167
+ readonly beerLambert: {
168
+ readonly kind: "measured";
169
+ readonly summary: "Each layer of a solution takes the same FRACTION of the light reaching it, so the light left falls away multiplicatively and its logarithm falls in step with both the concentration and the distance travelled.";
170
+ readonly evidence: "Measured: double the concentration of a coloured solution, or double the length of the cell, and the absorbance doubles. It stops holding at high concentrations, which is why a calibration curve is plotted rather than assumed and why a dark sample is diluted before it is read.";
171
+ };
172
+ readonly idealGas: {
173
+ readonly kind: "measured";
174
+ readonly summary: "Pressure times volume divided by temperature comes to the same thing for any gas, once there is enough of it to average over and the particles are far enough apart to ignore each other.";
175
+ readonly evidence: "Measured, and by three separate people on three separate pairs of variables before anyone combined them. It is a limit rather than a law: every real gas departs from it as it is compressed or cooled toward its boiling point, which is exactly when its particles stop being far apart.";
176
+ };
177
+ readonly heatEnergy: {
178
+ readonly kind: "definition";
179
+ readonly summary: "Specific heat capacity is defined as the energy one gram needs to warm by one kelvin, so the total is that energy times the grams times the kelvin.";
180
+ };
181
+ };
182
+ //#endregion
183
+ export { CONSTANTS, DERIVATIONS, absorbanceFromIntensity, beerLambert, combinedGasLaw, concentration, density, dilution, heatEnergy, idealGas, kelvinFrom, massForSolution, molality, molesFromGasVolume, molesFromMass, molesFromParticles, molesFromSolution };