@classytic/stage 0.3.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 (431) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  2. package/dist/atomic/aufbau.d.mts +144 -0
  3. package/dist/atomic/aufbau.mjs +384 -0
  4. package/dist/atomic/elements.d.mts +67 -0
  5. package/dist/atomic/elements.mjs +785 -0
  6. package/dist/atomic/emission.d.mts +112 -0
  7. package/dist/atomic/emission.mjs +179 -0
  8. package/dist/atomic/index.d.mts +8 -0
  9. package/dist/atomic/index.mjs +9 -0
  10. package/dist/atomic/periodic.d.mts +82 -0
  11. package/dist/atomic/periodic.mjs +231 -0
  12. package/dist/atomic/properties.d.mts +100 -0
  13. package/dist/atomic/properties.mjs +574 -0
  14. package/dist/atomic/shells.d.mts +137 -0
  15. package/dist/atomic/shells.mjs +170 -0
  16. package/dist/atomic/trends.d.mts +148 -0
  17. package/dist/atomic/trends.mjs +225 -0
  18. package/dist/chem/chromatography.d.mts +66 -0
  19. package/dist/chem/chromatography.mjs +63 -0
  20. package/dist/chem/complex.d.mts +114 -0
  21. package/dist/chem/complex.mjs +234 -0
  22. package/dist/chem/cycle.d.mts +75 -0
  23. package/dist/chem/cycle.mjs +145 -0
  24. package/dist/chem/equation.d.mts +86 -0
  25. package/dist/chem/equation.mjs +168 -0
  26. package/dist/chem/formula.d.mts +90 -0
  27. package/dist/chem/formula.mjs +201 -0
  28. package/dist/chem/functional-groups.d.mts +31 -0
  29. package/dist/chem/functional-groups.mjs +187 -0
  30. package/dist/chem/hazard.d.mts +94 -0
  31. package/dist/chem/hazard.mjs +329 -0
  32. package/dist/chem/index.d.mts +34 -33
  33. package/dist/chem/index.mjs +34 -28
  34. package/dist/chem/ionic.d.mts +98 -0
  35. package/dist/chem/ionic.mjs +156 -0
  36. package/dist/chem/layout.d.mts +46 -0
  37. package/dist/chem/layout.mjs +342 -0
  38. package/dist/chem/lewis.d.mts +79 -0
  39. package/dist/chem/lewis.mjs +163 -0
  40. package/dist/chem/molecular-orbital.d.mts +114 -0
  41. package/dist/chem/molecular-orbital.mjs +201 -0
  42. package/dist/chem/molecule.d.mts +154 -0
  43. package/dist/chem/molecule.mjs +282 -0
  44. package/dist/chem/nmr.d.mts +153 -0
  45. package/dist/chem/nmr.mjs +165 -0
  46. package/dist/chem/polymer.d.mts +65 -0
  47. package/dist/chem/polymer.mjs +179 -0
  48. package/dist/chem/redox.d.mts +138 -0
  49. package/dist/chem/redox.mjs +328 -0
  50. package/dist/chem/relations.d.mts +183 -0
  51. package/dist/chem/relations.mjs +299 -0
  52. package/dist/chem/skeleton.d.mts +51 -0
  53. package/dist/chem/skeleton.mjs +186 -0
  54. package/dist/chem/solution.d.mts +116 -0
  55. package/dist/chem/solution.mjs +186 -0
  56. package/dist/chem/species.d.mts +47 -0
  57. package/dist/chem/species.mjs +128 -0
  58. package/dist/chem/stereo.d.mts +108 -0
  59. package/dist/chem/stereo.mjs +286 -0
  60. package/dist/chem/stoichiometry.d.mts +95 -0
  61. package/dist/chem/stoichiometry.mjs +145 -0
  62. package/dist/chem/synthesis.d.mts +113 -0
  63. package/dist/chem/synthesis.mjs +281 -0
  64. package/dist/chem/vsepr.d.mts +80 -0
  65. package/dist/chem/vsepr.mjs +247 -0
  66. package/dist/circuit/ac.d.mts +163 -0
  67. package/dist/circuit/ac.mjs +452 -0
  68. package/dist/circuit/dc.d.mts +92 -0
  69. package/dist/circuit/dc.mjs +333 -0
  70. package/dist/circuit/index.d.mts +5 -92
  71. package/dist/circuit/index.mjs +5 -332
  72. package/dist/circuit/network.d.mts +99 -0
  73. package/dist/circuit/network.mjs +440 -0
  74. package/dist/circuit/topology.d.mts +102 -0
  75. package/dist/circuit/topology.mjs +143 -0
  76. package/dist/colour/absorption.d.mts +79 -0
  77. package/dist/colour/absorption.mjs +137 -0
  78. package/dist/colour/index.d.mts +6 -0
  79. package/dist/colour/index.mjs +7 -0
  80. package/dist/colour/name.d.mts +14 -0
  81. package/dist/colour/name.mjs +76 -0
  82. package/dist/colour/observer.d.mts +31 -0
  83. package/dist/colour/observer.mjs +46 -0
  84. package/dist/colour/spectrum.d.mts +61 -0
  85. package/dist/colour/spectrum.mjs +108 -0
  86. package/dist/colour/srgb.d.mts +49 -0
  87. package/dist/colour/srgb.mjs +108 -0
  88. package/dist/core/constants.d.mts +138 -0
  89. package/dist/core/constants.mjs +139 -0
  90. package/dist/core/index.d.mts +3 -1
  91. package/dist/core/index.mjs +3 -1
  92. package/dist/core/vec3.d.mts +94 -0
  93. package/dist/core/vec3.mjs +123 -0
  94. package/dist/core/worked.d.mts +35 -0
  95. package/dist/core/worked.mjs +44 -0
  96. package/dist/electro/cell.d.mts +102 -0
  97. package/dist/electro/cell.mjs +170 -0
  98. package/dist/electro/conductivity.d.mts +157 -0
  99. package/dist/electro/conductivity.mjs +156 -0
  100. package/dist/electro/couples.d.mts +114 -0
  101. package/dist/electro/couples.mjs +334 -0
  102. package/dist/electro/electrolysis.d.mts +96 -0
  103. package/dist/electro/electrolysis.mjs +274 -0
  104. package/dist/electro/faraday.d.mts +150 -0
  105. package/dist/electro/faraday.mjs +118 -0
  106. package/dist/electro/index.d.mts +6 -0
  107. package/dist/electro/index.mjs +7 -0
  108. package/dist/finance/accounting/adjustments.d.mts +17 -0
  109. package/dist/finance/accounting/adjustments.mjs +202 -0
  110. package/dist/finance/accounting/analysis.d.mts +8 -0
  111. package/dist/finance/accounting/analysis.mjs +205 -0
  112. package/dist/finance/accounting/clubs.d.mts +21 -0
  113. package/dist/finance/accounting/clubs.mjs +217 -0
  114. package/dist/finance/accounting/company-statements.d.mts +7 -0
  115. package/dist/finance/accounting/company-statements.mjs +150 -0
  116. package/dist/finance/accounting/harness.d.mts +7 -0
  117. package/dist/finance/accounting/harness.mjs +45 -0
  118. package/dist/finance/accounting/index.d.mts +18 -0
  119. package/dist/finance/accounting/index.mjs +18 -0
  120. package/dist/finance/accounting/journalize.d.mts +16 -0
  121. package/dist/finance/accounting/journalize.mjs +128 -0
  122. package/dist/finance/accounting/manufacturing.d.mts +8 -0
  123. package/dist/finance/accounting/manufacturing.mjs +236 -0
  124. package/dist/finance/accounting/partnership.d.mts +7 -0
  125. package/dist/finance/accounting/partnership.mjs +152 -0
  126. package/dist/finance/accounting/period-case.d.mts +6 -0
  127. package/dist/finance/accounting/period-case.mjs +71 -0
  128. package/dist/finance/accounting/post.d.mts +9 -0
  129. package/dist/finance/accounting/post.mjs +84 -0
  130. package/dist/finance/accounting/precision.d.mts +9 -0
  131. package/dist/finance/accounting/precision.mjs +15 -0
  132. package/dist/finance/accounting/rules.d.mts +21 -0
  133. package/dist/finance/accounting/rules.mjs +37 -0
  134. package/dist/finance/accounting/solve.d.mts +28 -0
  135. package/dist/finance/accounting/solve.mjs +92 -0
  136. package/dist/finance/accounting/statements.d.mts +7 -0
  137. package/dist/finance/accounting/statements.mjs +142 -0
  138. package/dist/finance/accounting/types.d.mts +649 -0
  139. package/dist/finance/accounting/validate.d.mts +7 -0
  140. package/dist/finance/accounting/validate.mjs +67 -0
  141. package/dist/finance/accounting/verification.d.mts +24 -0
  142. package/dist/finance/accounting/verification.mjs +386 -0
  143. package/dist/finance/bizsim.d.mts +21 -39
  144. package/dist/finance/bizsim.mjs +276 -97
  145. package/dist/finance/index.d.mts +20 -43
  146. package/dist/finance/index.mjs +19 -77
  147. package/dist/finance/investment-math.d.mts +7 -0
  148. package/dist/finance/investment-math.mjs +18 -0
  149. package/dist/finance/management-accounting/budgeting.d.mts +7 -0
  150. package/dist/finance/management-accounting/budgeting.mjs +189 -0
  151. package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
  152. package/dist/finance/management-accounting/cash-budget.mjs +154 -0
  153. package/dist/finance/management-accounting/costing.d.mts +8 -0
  154. package/dist/finance/management-accounting/costing.mjs +175 -0
  155. package/dist/finance/management-accounting/decisions.d.mts +8 -0
  156. package/dist/finance/management-accounting/decisions.mjs +164 -0
  157. package/dist/finance/management-accounting/index.d.mts +13 -0
  158. package/dist/finance/management-accounting/index.mjs +13 -0
  159. package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
  160. package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
  161. package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
  162. package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
  163. package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
  164. package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
  165. package/dist/finance/management-accounting/management-case.d.mts +8 -0
  166. package/dist/finance/management-accounting/management-case.mjs +91 -0
  167. package/dist/finance/management-accounting/master-budget.d.mts +7 -0
  168. package/dist/finance/management-accounting/master-budget.mjs +137 -0
  169. package/dist/finance/management-accounting/production-costing.d.mts +8 -0
  170. package/dist/finance/management-accounting/production-costing.mjs +214 -0
  171. package/dist/finance/management-accounting/types.d.mts +644 -0
  172. package/dist/finance/management-accounting/variances.d.mts +7 -0
  173. package/dist/finance/management-accounting/variances.mjs +150 -0
  174. package/dist/index.d.mts +6 -6
  175. package/dist/index.mjs +1 -1
  176. package/dist/math/analysis.d.mts +61 -0
  177. package/dist/math/analysis.mjs +187 -0
  178. package/dist/math/answer-check.d.mts +50 -0
  179. package/dist/math/answer-check.mjs +106 -0
  180. package/dist/math/calculus.d.mts +4 -9
  181. package/dist/math/calculus.mjs +216 -7
  182. package/dist/math/complex.d.mts +93 -0
  183. package/dist/math/complex.mjs +239 -0
  184. package/dist/math/expr.d.mts +23 -0
  185. package/dist/math/expr.mjs +36 -0
  186. package/dist/math/index.d.mts +8 -22
  187. package/dist/math/index.mjs +8 -37
  188. package/dist/math/latex.mjs +2 -1
  189. package/dist/math/parse.mjs +1 -1
  190. package/dist/math/poly.d.mts +55 -0
  191. package/dist/math/poly.mjs +273 -0
  192. package/dist/math/rearrange.d.mts +14 -0
  193. package/dist/math/rearrange.mjs +125 -0
  194. package/dist/math/solve.d.mts +21 -0
  195. package/dist/math/solve.mjs +75 -0
  196. package/dist/networking/addressing.d.mts +26 -0
  197. package/dist/networking/addressing.mjs +33 -0
  198. package/dist/networking/cloud/access.d.mts +36 -0
  199. package/dist/networking/cloud/access.mjs +95 -0
  200. package/dist/networking/cloud/containers.d.mts +43 -0
  201. package/dist/networking/cloud/containers.mjs +54 -0
  202. package/dist/networking/cloud/edge.d.mts +17 -0
  203. package/dist/networking/cloud/edge.mjs +31 -0
  204. package/dist/networking/cloud/failure-domains.d.mts +19 -0
  205. package/dist/networking/cloud/failure-domains.mjs +22 -0
  206. package/dist/networking/cloud/geo-routing.d.mts +22 -0
  207. package/dist/networking/cloud/geo-routing.mjs +64 -0
  208. package/dist/networking/cloud/index.d.mts +18 -0
  209. package/dist/networking/cloud/index.mjs +19 -0
  210. package/dist/networking/cloud/inference-reliability.d.mts +30 -0
  211. package/dist/networking/cloud/inference-reliability.mjs +76 -0
  212. package/dist/networking/cloud/inference.d.mts +118 -0
  213. package/dist/networking/cloud/inference.mjs +179 -0
  214. package/dist/networking/cloud/infrastructure.d.mts +45 -0
  215. package/dist/networking/cloud/infrastructure.mjs +96 -0
  216. package/dist/networking/cloud/observability.d.mts +24 -0
  217. package/dist/networking/cloud/observability.mjs +34 -0
  218. package/dist/networking/cloud/orchestration.d.mts +32 -0
  219. package/dist/networking/cloud/orchestration.mjs +38 -0
  220. package/dist/networking/cloud/recovery.d.mts +21 -0
  221. package/dist/networking/cloud/recovery.mjs +27 -0
  222. package/dist/networking/cloud/releases.d.mts +42 -0
  223. package/dist/networking/cloud/releases.mjs +135 -0
  224. package/dist/networking/cloud/scaling.d.mts +25 -0
  225. package/dist/networking/cloud/scaling.mjs +65 -0
  226. package/dist/networking/cloud/secrets.d.mts +39 -0
  227. package/dist/networking/cloud/secrets.mjs +68 -0
  228. package/dist/networking/cloud/server-deployment.d.mts +29 -0
  229. package/dist/networking/cloud/server-deployment.mjs +72 -0
  230. package/dist/networking/cloud/storage.d.mts +16 -0
  231. package/dist/networking/cloud/storage.mjs +58 -0
  232. package/dist/networking/cloud/vpc.d.mts +18 -0
  233. package/dist/networking/cloud/vpc.mjs +100 -0
  234. package/dist/networking/delivery.d.mts +34 -0
  235. package/dist/networking/delivery.mjs +52 -0
  236. package/dist/networking/index.d.mts +47 -0
  237. package/dist/networking/index.mjs +47 -0
  238. package/dist/networking/ipv6.d.mts +28 -0
  239. package/dist/networking/ipv6.mjs +17 -0
  240. package/dist/networking/journeys.d.mts +83 -0
  241. package/dist/networking/journeys.mjs +161 -0
  242. package/dist/networking/models/airtime.d.mts +87 -0
  243. package/dist/networking/models/airtime.mjs +130 -0
  244. package/dist/networking/models/cellular.d.mts +157 -0
  245. package/dist/networking/models/cellular.mjs +252 -0
  246. package/dist/networking/models/encapsulation.d.mts +98 -0
  247. package/dist/networking/models/encapsulation.mjs +132 -0
  248. package/dist/networking/models/handover.d.mts +116 -0
  249. package/dist/networking/models/handover.mjs +209 -0
  250. package/dist/networking/models/handshake.d.mts +90 -0
  251. package/dist/networking/models/handshake.mjs +122 -0
  252. package/dist/networking/models/index.d.mts +14 -0
  253. package/dist/networking/models/index.mjs +15 -0
  254. package/dist/networking/models/media.d.mts +82 -0
  255. package/dist/networking/models/media.mjs +188 -0
  256. package/dist/networking/models/satellite.d.mts +86 -0
  257. package/dist/networking/models/satellite.mjs +121 -0
  258. package/dist/networking/models/spectrum.d.mts +83 -0
  259. package/dist/networking/models/spectrum.mjs +235 -0
  260. package/dist/networking/models/switch.d.mts +80 -0
  261. package/dist/networking/models/switch.mjs +155 -0
  262. package/dist/networking/models/vlan.d.mts +62 -0
  263. package/dist/networking/models/vlan.mjs +100 -0
  264. package/dist/networking/models/vpn.d.mts +66 -0
  265. package/dist/networking/models/vpn.mjs +125 -0
  266. package/dist/networking/models/wifi-privacy.d.mts +82 -0
  267. package/dist/networking/models/wifi-privacy.mjs +130 -0
  268. package/dist/networking/models/wifi.d.mts +240 -0
  269. package/dist/networking/models/wifi.mjs +562 -0
  270. package/dist/networking/nat-traversal.d.mts +24 -0
  271. package/dist/networking/nat-traversal.mjs +38 -0
  272. package/dist/networking/protocols.d.mts +17 -0
  273. package/dist/networking/protocols.mjs +57 -0
  274. package/dist/networking/queue.d.mts +12 -0
  275. package/dist/networking/queue.mjs +18 -0
  276. package/dist/networking/route-learning.d.mts +23 -0
  277. package/dist/networking/route-learning.mjs +43 -0
  278. package/dist/networking/routing.d.mts +11 -0
  279. package/dist/networking/routing.mjs +25 -0
  280. package/dist/networking/signals.d.mts +26 -0
  281. package/dist/networking/signals.mjs +35 -0
  282. package/dist/networking/subnet.d.mts +49 -0
  283. package/dist/networking/subnet.mjs +89 -0
  284. package/dist/networking/tcp-reliability.d.mts +24 -0
  285. package/dist/networking/tcp-reliability.mjs +38 -0
  286. package/dist/networking/topology/contract.d.mts +123 -0
  287. package/dist/networking/topology/index.d.mts +4 -0
  288. package/dist/networking/topology/index.mjs +4 -0
  289. package/dist/networking/topology/presets.d.mts +7 -0
  290. package/dist/networking/topology/presets.mjs +302 -0
  291. package/dist/networking/topology/simulation.d.mts +8 -0
  292. package/dist/networking/topology/simulation.mjs +179 -0
  293. package/dist/networking/wireless.d.mts +11 -0
  294. package/dist/networking/wireless.mjs +17 -0
  295. package/dist/optics/imaging.d.mts +218 -0
  296. package/dist/optics/imaging.mjs +276 -0
  297. package/dist/optics/index.d.mts +7 -0
  298. package/dist/optics/index.mjs +8 -0
  299. package/dist/optics/laws.d.mts +70 -0
  300. package/dist/optics/laws.mjs +195 -0
  301. package/dist/optics/prism.d.mts +148 -0
  302. package/dist/optics/prism.mjs +197 -0
  303. package/dist/optics/refraction.d.mts +201 -0
  304. package/dist/optics/refraction.mjs +270 -0
  305. package/dist/optics/wave-optics.d.mts +171 -0
  306. package/dist/optics/wave-optics.mjs +259 -0
  307. package/dist/physics/ac/index.d.mts +183 -0
  308. package/dist/physics/ac/index.mjs +203 -0
  309. package/dist/physics/dynamics/forces.d.mts +98 -0
  310. package/dist/physics/dynamics/forces.mjs +153 -0
  311. package/dist/physics/dynamics/friction.d.mts +76 -0
  312. package/dist/physics/dynamics/friction.mjs +119 -0
  313. package/dist/physics/dynamics/system.d.mts +68 -0
  314. package/dist/physics/dynamics/system.mjs +125 -0
  315. package/dist/physics/electrostatics/index.d.mts +169 -0
  316. package/dist/physics/electrostatics/index.mjs +249 -0
  317. package/dist/physics/energy/centre-of-mass.d.mts +115 -0
  318. package/dist/physics/energy/centre-of-mass.mjs +180 -0
  319. package/dist/physics/energy/conservation.d.mts +81 -0
  320. package/dist/physics/energy/conservation.mjs +129 -0
  321. package/dist/physics/energy/power.d.mts +90 -0
  322. package/dist/physics/energy/power.mjs +167 -0
  323. package/dist/physics/energy/spring.d.mts +73 -0
  324. package/dist/physics/energy/spring.mjs +129 -0
  325. package/dist/physics/energy/store.d.mts +63 -0
  326. package/dist/physics/energy/store.mjs +108 -0
  327. package/dist/physics/energy/theorem.d.mts +65 -0
  328. package/dist/physics/energy/theorem.mjs +113 -0
  329. package/dist/physics/energy/work.d.mts +114 -0
  330. package/dist/physics/energy/work.mjs +219 -0
  331. package/dist/physics/gravitation/body.d.mts +85 -0
  332. package/dist/physics/gravitation/body.mjs +168 -0
  333. package/dist/physics/gravitation/kepler.d.mts +127 -0
  334. package/dist/physics/gravitation/kepler.mjs +216 -0
  335. package/dist/physics/gravitation/law.d.mts +117 -0
  336. package/dist/physics/gravitation/law.mjs +175 -0
  337. package/dist/physics/gravitation/orbit.d.mts +119 -0
  338. package/dist/physics/gravitation/orbit.mjs +202 -0
  339. package/dist/physics/gravitation/potential.d.mts +114 -0
  340. package/dist/physics/gravitation/potential.mjs +202 -0
  341. package/dist/physics/gravitation/variation.d.mts +97 -0
  342. package/dist/physics/gravitation/variation.mjs +175 -0
  343. package/dist/physics/index.d.mts +35 -0
  344. package/dist/physics/index.mjs +36 -0
  345. package/dist/physics/integral-sweep.d.mts +63 -0
  346. package/dist/physics/integral-sweep.mjs +126 -0
  347. package/dist/physics/kinematics/equations.d.mts +47 -0
  348. package/dist/physics/kinematics/equations.mjs +126 -0
  349. package/dist/physics/kinematics/free-fall.d.mts +53 -0
  350. package/dist/physics/kinematics/free-fall.mjs +71 -0
  351. package/dist/physics/kinematics/given.d.mts +16 -0
  352. package/dist/physics/kinematics/given.mjs +55 -0
  353. package/dist/physics/kinematics/roots.d.mts +41 -0
  354. package/dist/physics/kinematics/roots.mjs +72 -0
  355. package/dist/physics/kinematics/solve.d.mts +52 -0
  356. package/dist/physics/kinematics/solve.mjs +172 -0
  357. package/dist/physics/magnetism/biot-savart.d.mts +161 -0
  358. package/dist/physics/magnetism/biot-savart.mjs +353 -0
  359. package/dist/physics/magnetism/flux.d.mts +94 -0
  360. package/dist/physics/magnetism/flux.mjs +313 -0
  361. package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
  362. package/dist/physics/magnetism/geomagnetism.mjs +184 -0
  363. package/dist/physics/magnetism/index.d.mts +12 -0
  364. package/dist/physics/magnetism/index.mjs +74 -0
  365. package/dist/physics/magnetism/lorentz.d.mts +28 -0
  366. package/dist/physics/magnetism/lorentz.mjs +88 -0
  367. package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
  368. package/dist/physics/magnetism/magnetic-force.mjs +169 -0
  369. package/dist/physics/momentum/collide.d.mts +77 -0
  370. package/dist/physics/momentum/collide.mjs +115 -0
  371. package/dist/physics/momentum/impulse.d.mts +89 -0
  372. package/dist/physics/momentum/impulse.mjs +159 -0
  373. package/dist/physics/momentum/planar.d.mts +60 -0
  374. package/dist/physics/momentum/planar.mjs +110 -0
  375. package/dist/physics/projectile.d.mts +107 -0
  376. package/dist/physics/projectile.mjs +185 -0
  377. package/dist/physics/rotation/angular.d.mts +85 -0
  378. package/dist/physics/rotation/angular.mjs +130 -0
  379. package/dist/physics/rotation/circular.d.mts +79 -0
  380. package/dist/physics/rotation/circular.mjs +131 -0
  381. package/dist/physics/rotation/inertia.d.mts +164 -0
  382. package/dist/physics/rotation/inertia.mjs +332 -0
  383. package/dist/physics/rotation/torque.d.mts +65 -0
  384. package/dist/physics/rotation/torque.mjs +134 -0
  385. package/dist/physics/vectors.d.mts +64 -0
  386. package/dist/physics/vectors.mjs +114 -0
  387. package/dist/quantity/index.d.mts +119 -0
  388. package/dist/quantity/index.mjs +417 -0
  389. package/dist/relation/derive.d.mts +74 -0
  390. package/dist/relation/derive.mjs +73 -0
  391. package/dist/relation/index.d.mts +56 -0
  392. package/dist/relation/index.mjs +234 -0
  393. package/dist/scene/evaluators.mjs +1 -1
  394. package/dist/sim/thermal.mjs +45 -20
  395. package/dist/thermo/calorimetry.d.mts +207 -0
  396. package/dist/thermo/calorimetry.mjs +345 -0
  397. package/dist/thermo/cycles.d.mts +142 -0
  398. package/dist/thermo/cycles.mjs +256 -0
  399. package/dist/thermo/entropy.d.mts +87 -0
  400. package/dist/thermo/entropy.mjs +140 -0
  401. package/dist/thermo/expansion.d.mts +130 -0
  402. package/dist/thermo/expansion.mjs +178 -0
  403. package/dist/thermo/gas.d.mts +197 -0
  404. package/dist/thermo/gas.mjs +279 -0
  405. package/dist/thermo/heat-transfer.d.mts +164 -0
  406. package/dist/thermo/heat-transfer.mjs +217 -0
  407. package/dist/thermo/index.d.mts +9 -82
  408. package/dist/thermo/index.mjs +9 -132
  409. package/dist/thermo/processes.d.mts +95 -0
  410. package/dist/thermo/processes.mjs +154 -0
  411. package/dist/thermo/temperature.d.mts +174 -0
  412. package/dist/thermo/temperature.mjs +236 -0
  413. package/dist/waves/damping.d.mts +224 -0
  414. package/dist/waves/damping.mjs +317 -0
  415. package/dist/waves/doppler.d.mts +72 -0
  416. package/dist/waves/doppler.mjs +125 -0
  417. package/dist/waves/index.d.mts +10 -0
  418. package/dist/waves/index.mjs +10 -0
  419. package/dist/waves/pendulum.d.mts +130 -0
  420. package/dist/waves/pendulum.mjs +211 -0
  421. package/dist/waves/pitch.d.mts +125 -0
  422. package/dist/waves/pitch.mjs +158 -0
  423. package/dist/waves/shm.d.mts +170 -0
  424. package/dist/waves/shm.mjs +279 -0
  425. package/dist/waves/springs.d.mts +103 -0
  426. package/dist/waves/springs.mjs +176 -0
  427. package/dist/waves/superposition.d.mts +124 -0
  428. package/dist/waves/superposition.mjs +196 -0
  429. package/dist/waves/wave.d.mts +154 -0
  430. package/dist/waves/wave.mjs +178 -0
  431. package/package.json +74 -2
@@ -0,0 +1,329 @@
1
+ //#region src/chem/hazard.ts
2
+ /**
3
+ * Precautions that score nothing, because they are true of every experiment.
4
+ *
5
+ * Kept as a list rather than a judgement so that it can be tested against, and so a lesson gate can
6
+ * one day refuse a hazard answer built only from these.
7
+ */
8
+ const GENERIC = [
9
+ "wear safety goggles",
10
+ "wear goggles",
11
+ "wear eye protection",
12
+ "wear a lab coat",
13
+ "wear gloves",
14
+ "be careful",
15
+ "take care",
16
+ "wash your hands",
17
+ "tie back long hair"
18
+ ];
19
+ /**
20
+ * True when a precaution is one of the generic ones and would score nothing on its own.
21
+ *
22
+ * Note the "on its own": gloves are a real precaution when they follow from a named corrosive
23
+ * substance, which is why the entries below that use them say what they are for.
24
+ */
25
+ const isGenericPrecaution = (text) => {
26
+ const t = text.trim().toLowerCase().replace(/[.]$/, "");
27
+ return GENERIC.some((g) => t === g || t === `${g}.`);
28
+ };
29
+ /**
30
+ * The reagents our chemistry labs actually put in a learner's hand.
31
+ *
32
+ * Added to when a lab needs one, never speculatively: an entry nobody reads is an entry nobody
33
+ * checks.
34
+ */
35
+ const REAGENTS = [
36
+ {
37
+ id: "ammonia-concentrated",
38
+ name: "concentrated aqueous ammonia",
39
+ formula: "NH3",
40
+ strength: "concentrated",
41
+ hazards: [{
42
+ hazard: "corrosive",
43
+ statement: "it burns skin and eyes on contact",
44
+ precaution: "wear gloves, and dilute any splash with plenty of cold water at once"
45
+ }, {
46
+ hazard: "harmful",
47
+ statement: "it gives off a pungent vapour that irritates the lungs",
48
+ precaution: "use it in a fume cupboard and keep the bottle stoppered between additions"
49
+ }]
50
+ },
51
+ {
52
+ id: "ammonia-dilute",
53
+ name: "dilute aqueous ammonia",
54
+ formula: "NH3",
55
+ strength: "dilute",
56
+ hazards: [{
57
+ hazard: "irritant",
58
+ statement: "it irritates skin and eyes, and its vapour irritates the lungs",
59
+ precaution: "keep the bottle stoppered and work in a ventilated room"
60
+ }]
61
+ },
62
+ {
63
+ id: "sulfuric-concentrated",
64
+ name: "concentrated sulfuric acid",
65
+ formula: "H2SO4",
66
+ strength: "concentrated",
67
+ hazards: [{
68
+ hazard: "corrosive",
69
+ statement: "it destroys skin and eyes, and it dehydrates paper and sugar on contact",
70
+ precaution: "wear gloves, and add the acid to water rather than water to the acid"
71
+ }]
72
+ },
73
+ {
74
+ id: "sulfuric-dilute",
75
+ name: "dilute sulfuric acid",
76
+ formula: "H2SO4",
77
+ strength: "dilute",
78
+ hazards: [{
79
+ hazard: "irritant",
80
+ statement: "it irritates skin and stings in a cut",
81
+ precaution: "rinse any splash off under the tap before continuing"
82
+ }]
83
+ },
84
+ {
85
+ id: "sodium-hydroxide",
86
+ name: "aqueous sodium hydroxide",
87
+ formula: "NaOH",
88
+ strength: "solution",
89
+ hazards: [{
90
+ hazard: "corrosive",
91
+ statement: "it attacks skin and is especially damaging to eyes, where it does not sting at first",
92
+ precaution: "wear gloves, and flood any eye splash with water for ten minutes"
93
+ }]
94
+ },
95
+ {
96
+ id: "manganate-vii",
97
+ name: "acidified potassium manganate(VII)",
98
+ formula: "KMnO4",
99
+ strength: "solution",
100
+ hazards: [{
101
+ hazard: "oxidising",
102
+ statement: "it reacts vigorously with anything that can be oxidised, including paper and skin",
103
+ precaution: "keep it away from the ethanol and the paper towels on the bench"
104
+ }, {
105
+ hazard: "harmful",
106
+ statement: "it stains skin brown and the stain is manganese(IV) oxide, not dye",
107
+ precaution: "fill the burette with a funnel rather than pouring from the bottle"
108
+ }]
109
+ },
110
+ {
111
+ id: "dichromate-vi",
112
+ name: "potassium dichromate(VI)",
113
+ formula: "K2Cr2O7",
114
+ strength: "solution",
115
+ hazards: [{
116
+ hazard: "carcinogenic",
117
+ statement: "chromium(VI) causes cancer and is absorbed through skin",
118
+ precaution: "handle it only as a made-up solution, wear gloves, and never weigh the solid out yourself"
119
+ }, {
120
+ hazard: "environmental",
121
+ statement: "it is toxic to aquatic life",
122
+ precaution: "pour the residues into the labelled chromium waste bottle, not down the sink"
123
+ }]
124
+ },
125
+ {
126
+ id: "nickel-salt",
127
+ name: "a soluble nickel(II) salt",
128
+ formula: "NiSO4",
129
+ strength: "solution",
130
+ hazards: [{
131
+ hazard: "carcinogenic",
132
+ statement: "nickel compounds are carcinogenic if their dust is breathed in",
133
+ precaution: "use the prepared solution and never grind or weigh the solid"
134
+ }, {
135
+ hazard: "harmful",
136
+ statement: "repeated skin contact causes a lasting nickel allergy",
137
+ precaution: "wear gloves, because the sensitisation does not wear off once it has started"
138
+ }]
139
+ },
140
+ {
141
+ id: "copper-salt",
142
+ name: "a soluble copper(II) salt",
143
+ formula: "CuSO4",
144
+ strength: "solution",
145
+ hazards: [{
146
+ hazard: "harmful",
147
+ statement: "it is harmful if swallowed",
148
+ precaution: "fill the pipette with a filler, never by mouth"
149
+ }, {
150
+ hazard: "environmental",
151
+ statement: "it is very toxic to aquatic life",
152
+ precaution: "pour the residues into the heavy-metal waste bottle, not down the sink"
153
+ }]
154
+ },
155
+ {
156
+ id: "barium-salt",
157
+ name: "a soluble barium salt",
158
+ formula: "BaCl2",
159
+ strength: "solution",
160
+ hazards: [{
161
+ hazard: "toxic",
162
+ statement: "soluble barium salts are poisonous if swallowed",
163
+ precaution: "fill the pipette with a filler, and wash hands before leaving the laboratory"
164
+ }]
165
+ },
166
+ {
167
+ id: "phenol",
168
+ name: "phenol solution",
169
+ formula: "C6H5OH",
170
+ strength: "solution",
171
+ hazards: [{
172
+ hazard: "corrosive",
173
+ statement: "it burns skin badly, and the burn is numb at first because phenol deadens the nerves",
174
+ precaution: "wear gloves, and wash any splash off immediately even if it does not hurt"
175
+ }, {
176
+ hazard: "toxic",
177
+ statement: "it is absorbed through unbroken skin and is poisonous that way",
178
+ precaution: "make up and run the solvent in a fume cupboard, and never handle it barehanded"
179
+ }]
180
+ },
181
+ {
182
+ id: "hydrochloric-concentrated",
183
+ name: "concentrated hydrochloric acid",
184
+ formula: "HCl",
185
+ strength: "concentrated",
186
+ hazards: [{
187
+ hazard: "corrosive",
188
+ statement: "it burns skin and gives off choking hydrogen chloride fumes",
189
+ precaution: "keep the bottle in the fume cupboard and carry the sample to it, not the reverse"
190
+ }]
191
+ },
192
+ {
193
+ id: "nitric-acid-dilute",
194
+ name: "dilute nitric acid",
195
+ formula: "HNO3",
196
+ strength: "dilute",
197
+ hazards: [{
198
+ hazard: "irritant",
199
+ statement: "it irritates skin and leaves a yellow stain where it touches",
200
+ precaution: "acidify with a teat pipette rather than pouring from the bottle"
201
+ }]
202
+ },
203
+ {
204
+ id: "limewater",
205
+ name: "limewater",
206
+ formula: "Ca(OH)2",
207
+ strength: "solution",
208
+ hazards: [{
209
+ hazard: "irritant",
210
+ statement: "it is alkaline and irritates the eyes",
211
+ precaution: "bubble the gas through it rather than shaking the tube, so it cannot splash up"
212
+ }]
213
+ },
214
+ {
215
+ id: "sulfur-dioxide",
216
+ name: "sulfur dioxide",
217
+ formula: "SO2",
218
+ strength: "gas",
219
+ hazards: [{
220
+ hazard: "toxic",
221
+ statement: "it is a choking gas that triggers asthma at very low concentrations",
222
+ precaution: "generate it in a fume cupboard and stopper the tube between tests"
223
+ }]
224
+ },
225
+ {
226
+ id: "silver-nitrate",
227
+ name: "aqueous silver nitrate",
228
+ formula: "AgNO3",
229
+ strength: "solution",
230
+ hazards: [{
231
+ hazard: "corrosive",
232
+ statement: "it burns skin and leaves a black stain that takes days to wear off",
233
+ precaution: "wear gloves, and add it dropwise from a teat pipette rather than pouring"
234
+ }]
235
+ },
236
+ {
237
+ id: "bromine",
238
+ name: "bromine",
239
+ formula: "Br2",
240
+ strength: "concentrated",
241
+ hazards: [{
242
+ hazard: "toxic",
243
+ statement: "its vapour is toxic and it causes deep burns that heal slowly",
244
+ precaution: "use it in a fume cupboard, as bromine water rather than the liquid"
245
+ }]
246
+ },
247
+ {
248
+ id: "chlorine",
249
+ name: "chlorine",
250
+ formula: "Cl2",
251
+ strength: "gas",
252
+ hazards: [{
253
+ hazard: "toxic",
254
+ statement: "it damages the lungs and is dense enough to collect in a sink",
255
+ precaution: "generate and use it in a fume cupboard with the sash low"
256
+ }]
257
+ },
258
+ {
259
+ id: "ethanol",
260
+ name: "ethanol",
261
+ formula: "C2H5OH",
262
+ strength: "concentrated",
263
+ hazards: [{
264
+ hazard: "flammable",
265
+ statement: "its vapour catches fire easily and the flame is almost invisible",
266
+ precaution: "heat it in a water bath and turn off every Bunsen burner in the room first"
267
+ }]
268
+ },
269
+ {
270
+ id: "potassium-cyanide",
271
+ name: "potassium cyanide",
272
+ formula: "KCN",
273
+ strength: "solution",
274
+ hazards: [{
275
+ hazard: "toxic",
276
+ statement: "it is acutely poisonous, and any acid added to it releases hydrogen cyanide gas",
277
+ precaution: "never let it meet an acid, and use it only in a fume cupboard"
278
+ }]
279
+ },
280
+ {
281
+ id: "hydrogen",
282
+ name: "hydrogen",
283
+ formula: "H2",
284
+ strength: "gas",
285
+ hazards: [{
286
+ hazard: "explosive",
287
+ statement: "it forms an explosive mixture with air over a wide range of compositions",
288
+ precaution: "let it flush the apparatus through before any flame is brought near"
289
+ }]
290
+ }
291
+ ];
292
+ const reagentById = (id) => REAGENTS.find((r) => r.id === id);
293
+ /** Every reagent carrying a given hazard class, for a lesson that groups by hazard. */
294
+ const reagentsWith = (hazard) => REAGENTS.filter((r) => r.hazards.some((h) => h.hazard === hazard));
295
+ /**
296
+ * The creditable sentence: substance, hazard, precaution.
297
+ *
298
+ * Built rather than authored, so that every lab and every lesson states a hazard the same way and
299
+ * a learner meets the same three-part shape every time. That repetition is the teaching: the shape
300
+ * of the sentence is what the exam pays for.
301
+ */
302
+ const hazardSentence = (reagent, hazard) => `${reagent.name} is ${hazard.hazard}: ${hazard.statement}, so ${hazard.precaution}.`;
303
+ /** Every creditable sentence for a reagent. */
304
+ const hazardSentences = (reagent) => reagent.hazards.map((h) => hazardSentence(reagent, h));
305
+ /**
306
+ * The single most serious hazard a reagent carries, for a one-line warning.
307
+ *
308
+ * Ordered by what would hurt a learner most, not alphabetically. A substance that is both an
309
+ * irritant and a carcinogen must not be introduced as an irritant.
310
+ */
311
+ const SEVERITY = [
312
+ "explosive",
313
+ "carcinogenic",
314
+ "toxic",
315
+ "corrosive",
316
+ "flammable",
317
+ "oxidising",
318
+ "harmful",
319
+ "irritant",
320
+ "environmental"
321
+ ];
322
+ function worstHazard(reagent) {
323
+ const first = [...reagent.hazards].sort((a, b) => SEVERITY.indexOf(a.hazard) - SEVERITY.indexOf(b.hazard))[0];
324
+ if (!first) throw new Error(`${reagent.name} has no hazards declared.`);
325
+ return first;
326
+ }
327
+
328
+ //#endregion
329
+ export { REAGENTS, hazardSentence, hazardSentences, isGenericPrecaution, reagentById, reagentsWith, worstHazard };
@@ -1,8 +1,37 @@
1
+ import { Cycle, CycleSolution, CycleSpec, CycleTerm, DEFAULT_CYCLE_UNIT, cycle } from "./cycle.mjs";
2
+ import { HalfEquation, IonicEquation, Medium, Species, Term as Term$1, balanceHalf, combineHalves, halfToString, halfToUnicode, ionicToString, ionicToUnicode, oxidationChange, oxidationNumbers, parseSpecies, speciesToUnicode } from "./redox.mjs";
3
+ import { AVOGADRO, ColourResult, ComplexSpec, Geometry, LIGANDS, LIGHT_SPEED, Ligand, PLANCK, StereoResult, bondAngle, complexCharge, complexFormula, coordinationNumber, geometryOf, observedColour, splittingEnergy, splittingEnergyPerMole, stereoisomers, wavelengthFor } from "./complex.mjs";
4
+ import { Hazard, HazardClass, REAGENTS, Reagent, Strength, hazardSentence, hazardSentences, isGenericPrecaution, reagentById, reagentsWith, worstHazard } from "./hazard.mjs";
5
+ import { GROUP_LABELS, GROUP_NODES, GroupNode, ROUTE_EDGES, Route, RouteEdge, allRoutes, chainChangingEdges, edgeBetween, edgesAlong, edgesFrom, findRoute, shortestSteps } from "./synthesis.mjs";
6
+ import { MULTIPLICITY_NAMES, Multiplicity, NmrMolecule, NmrPeak, NmrSpectrum, ProtonEnvironment, SHIFT_RANGES, ShiftKey, ShiftRange, afterD2O, integrationRatio, linePositions, multiplicityOf, predictNmr, splittingPattern } from "./nmr.mjs";
7
+ import { ATOMIC_MASS, Atom, Bond, Element, Structure, atomCounts, bondOrderSum, bondsAt, carbonCount, chargedValence, degreesOfUnsaturation, formatCounts, implicitHydrogens, molecularFormula, neighbours, otherEnd, parseSmiles, relativeMass, ringCount, totalCharge } from "./molecule.mjs";
8
+ import { Backbone, backboneOf, longestChain, ringSystems } from "./skeleton.mjs";
9
+ import { LaidOut, Point, freeDirection, freeDirections, layout, layoutOf, ringCentre } from "./layout.mjs";
10
+ import { FoundGroup, GroupKind, functionalGroups, groupKinds, hasGroup } from "./functional-groups.mjs";
11
+ import { LinkKind, PolymerKind, RepeatUnit, addition, canSustainChain, chainMass, condensation, unitsInChain } from "./polymer.mjs";
12
+ import { Component, Identification, identify, resolvedBy, retentionFactor, spotDistance, unresolvedPairs } from "./chromatography.mjs";
13
+ import { ElementCount, MassFraction, empiricalFormula, formatFormula, molarMass, molecularFormulaFor, parseFormula, percentComposition, unitsInMolecule } from "./formula.mjs";
14
+ import { Bonded, Centre, CentreOptions, formatCentre, parseCentre, readFormula } from "./species.mjs";
15
+ import { BalancedEquation, Term, atomTally, balance, chargeTally, formatEquation, splitEquation } from "./equation.mjs";
16
+ import { DoubleBondShape, DoubleBondStereo, RankedSubstituent, Stereocentre, StereoisomerCount, compareBranches, comparePriority, maximumStereoisomers, rankSubstituents, stereocentres, stereogenicDoubleBonds, stereoisomerCount } from "./stereo.mjs";
17
+ import { PrecipitationCheck, PrecipitationVerdict, SOLUBILITY_PRODUCTS, SaltFormula, SparinglySoluble, ionicProduct, kspComparisonMisleads, kspFromSolubility, moreSoluble, saltByFormula, solubilityFromKsp, solubilityWithCommonIon, willPrecipitate } from "./solution.mjs";
18
+ import { ANIONS, CATIONS, IONS, Ion, IonicCompound, assessCounts, compoundOf, ionByName, ionicCompound, neutralRatio, writeIon } from "./ionic.mjs";
19
+ import { CONSTANTS, DERIVATIONS, absorbanceFromIntensity, beerLambert, combinedGasLaw, concentration, density, dilution, heatEnergy, idealGas, kelvinFrom, massForSolution, molality, molesFromGasVolume, molesFromMass, molesFromParticles, molesFromSolution } from "./relations.mjs";
20
+ import { Amount, ProductState, ReactantState, Reaction, YieldReport, amountNeeded, apparentYield, molesOf, percentageYield, react, theoreticalYield } from "./stoichiometry.mjs";
21
+ import { DiatomicResult, Level, Magnetism, MolecularOrbital, S_P_MIXING_NOTE, diatomic, fillOrbitals, formatOccupancy, orbitalSequence } from "./molecular-orbital.mjs";
22
+ import { LewisCount, OctetStatus, lewisCount, octetStatus, valenceElectronsFor } from "./lewis.mjs";
23
+ import { Vec3 } from "../core/vec3.mjs";
24
+ import { ElectronGeometry, MolecularShape, OBSERVED_ANGLES, Region, angleBetween, directionsFor, placeLonePairs, shapeOf } from "./vsepr.mjs";
25
+
1
26
  //#region src/chem/index.d.ts
2
27
  /**
3
- * `chem`, acid–base / pH AND electrochemistry / Nernst, as a PURE kernel (no
4
- * React, no pixels). The engine behind titration curves, pH problems, and galvanic
5
- * cells.
28
+ * `chem`, acid–base / pH and chemical kinetics, as a PURE kernel (no React, no
29
+ * pixels). The engine behind titration curves, pH problems and rate laws.
30
+ *
31
+ * This header used to claim electrochemistry as well, and for a while that was one
32
+ * function taking standard electrode potentials it did not hold. Electrochemistry
33
+ * is now its own subpath, `@classytic/stage/electro`, with the series, electrolysis,
34
+ * Faraday's laws and conductivity in it.
6
35
  *
7
36
  * pH at any point is found by solving the exact charge balance for [H⁺] = h:
8
37
  *
@@ -48,37 +77,9 @@ interface TitrationCurve {
48
77
  /** Sample the full titration curve from 0 to `span`·vEq (default 2×). */
49
78
  declare function titrationCurve(spec: TitrationSpec, n?: number, span?: number): TitrationCurve;
50
79
  /** Universal gas constant, J/(mol·K). */
51
- declare const R = 8.314462618;
52
- /** Faraday constant, C/mol. */
53
- declare const F = 96485.332;
80
+ declare const R: number;
54
81
  /** Standard temperature, K (25 °C). */
55
82
  declare const T_STD = 298.15;
56
- interface HalfCell {
57
- /** Electrode metal symbol (e.g. 'Zn'). */
58
- metal: string;
59
- /** Ion charge z in Mᶻ⁺ (e.g. 2 for Zn²⁺). */
60
- z: number;
61
- /** Standard reduction potential E°, volts. */
62
- E0: number;
63
- /** Ion concentration [Mᶻ⁺], mol/L. */
64
- conc: number;
65
- }
66
- interface CellResult {
67
- cathode: HalfCell;
68
- anode: HalfCell;
69
- /** Standard cell potential E°cell = E°cathode − E°anode, V. */
70
- E0cell: number;
71
- /** Electrons transferred (balances the half-reactions). */
72
- n: number;
73
- /** Reaction quotient Q = [anode ion]^(n/zₐ) / [cathode ion]^(n/z_c). */
74
- Q: number;
75
- /** Actual cell potential from the Nernst equation, V. */
76
- E: number;
77
- /** Does the cell drive current as written (E > 0)? */
78
- spontaneous: boolean;
79
- }
80
- /** Galvanic cell from two half-cells; cathode/anode assigned by standard potential. */
81
- declare function galvanicCell(x: HalfCell, y: HalfCell, T?: number): CellResult;
82
83
  /** Arrhenius rate constant k = A·e^(−Ea/RT). */
83
84
  declare function arrhenius(A: number, Ea: number, T: number): number;
84
85
  /** Ratio k(T)/k(Tref) at fixed Ea, the stable way to scale a rate without a raw A. */
@@ -115,4 +116,4 @@ interface StoichResult {
115
116
  /** Solve a balanced reaction for the limiting reagent, extent, products and leftovers. */
116
117
  declare function solveStoichiometry(reactants: StoichSpecies[], products: StoichSpecies[], amountsMol: number[]): StoichResult;
117
118
  //#endregion
118
- export { Analyte, CellResult, F, HalfCell, Kw, R, RateOrder, StoichResult, StoichSpecies, T_STD, TitrationCurve, TitrationSpec, arrhenius, arrheniusRatio, concAt, fractionAboveEa, galvanicCell, halfLife, pHAt, solveStoichiometry, titrationCurve };
119
+ export { ANIONS, ATOMIC_MASS, AVOGADRO, type Amount, Analyte, type Atom, type Backbone, type BalancedEquation, type Bond, type Bonded, CATIONS, CONSTANTS, type Centre, type CentreOptions, type ColourResult, type ComplexSpec, type Component, Cycle, type CycleSolution, type CycleSpec, type CycleTerm, DEFAULT_CYCLE_UNIT, DERIVATIONS, type DiatomicResult, type DoubleBondShape, type DoubleBondStereo, type ElectronGeometry, type Element, type ElementCount, type Term as EquationTerm, type FoundGroup, GROUP_LABELS, GROUP_NODES, type Geometry, type GroupKind, type GroupNode, type HalfEquation, type Hazard, type HazardClass, IONS, type Identification, type Ion, type IonicCompound, type IonicEquation, Kw, LIGANDS, LIGHT_SPEED, type LaidOut, type Level, type LewisCount, type Ligand, type LinkKind, MULTIPLICITY_NAMES, type Magnetism, type MassFraction, type Medium, type MolecularOrbital, type MolecularShape, type Multiplicity, type NmrMolecule, type NmrPeak, type NmrSpectrum, OBSERVED_ANGLES, type OctetStatus, PLANCK, type Point, type PolymerKind, type PrecipitationCheck, type PrecipitationVerdict, type ProductState, type ProtonEnvironment, R, REAGENTS, ROUTE_EDGES, type RankedSubstituent, RateOrder, type ReactantState, type Reaction, type Reagent, type Region, type RepeatUnit, type Route, type RouteEdge, SHIFT_RANGES, SOLUBILITY_PRODUCTS, S_P_MIXING_NOTE, type SaltFormula, type ShiftKey, type ShiftRange, type SparinglySoluble, type Species, type StereoResult, type Stereocentre, type StereoisomerCount, StoichResult, StoichSpecies, type Strength, type Structure, T_STD, type Term$1 as Term, TitrationCurve, TitrationSpec, type Vec3, type YieldReport, absorbanceFromIntensity, addition, afterD2O, allRoutes, amountNeeded, angleBetween, apparentYield, arrhenius, arrheniusRatio, assessCounts, atomCounts, atomTally, backboneOf, balance, balanceHalf, beerLambert, bondAngle, bondOrderSum, bondsAt, canSustainChain, carbonCount, chainChangingEdges, chainMass, chargeTally, chargedValence, combineHalves, combinedGasLaw, compareBranches, comparePriority, complexCharge, complexFormula, compoundOf, concAt, concentration, condensation, coordinationNumber, cycle, degreesOfUnsaturation, density, diatomic, dilution, directionsFor, edgeBetween, edgesAlong, edgesFrom, empiricalFormula, fillOrbitals, findRoute, formatCentre, formatCounts, formatEquation, formatFormula, formatOccupancy, fractionAboveEa, freeDirection, freeDirections, functionalGroups, geometryOf, groupKinds, halfLife, halfToString, halfToUnicode, hasGroup, hazardSentence, hazardSentences, heatEnergy, idealGas, identify, implicitHydrogens, integrationRatio, ionByName, ionicCompound, ionicProduct, ionicToString, ionicToUnicode, isGenericPrecaution, kelvinFrom, kspComparisonMisleads, kspFromSolubility, layout, layoutOf, lewisCount, linePositions, longestChain, massForSolution, maximumStereoisomers, molality, molarMass, molecularFormula, molecularFormulaFor, molesFromGasVolume, molesFromMass, molesFromParticles, molesFromSolution, molesOf, moreSoluble, multiplicityOf, neighbours, neutralRatio, observedColour, octetStatus, orbitalSequence, otherEnd, oxidationChange, oxidationNumbers, pHAt, parseCentre, parseFormula, parseSmiles, parseSpecies, percentComposition, percentageYield, placeLonePairs, predictNmr, rankSubstituents, react, readFormula, reagentById, reagentsWith, relativeMass, resolvedBy, retentionFactor, ringCentre, ringCount, ringSystems, saltByFormula, shapeOf, shortestSteps, solubilityFromKsp, solubilityWithCommonIon, solveStoichiometry, speciesToUnicode, splitEquation, splittingEnergy, splittingEnergyPerMole, splittingPattern, spotDistance, stereocentres, stereogenicDoubleBonds, stereoisomerCount, stereoisomers, theoreticalYield, titrationCurve, totalCharge, unitsInChain, unitsInMolecule, unresolvedPairs, valenceElectronsFor, wavelengthFor, willPrecipitate, worstHazard, writeIon };
@@ -1,8 +1,37 @@
1
+ import { GAS_CONSTANT } from "../core/constants.mjs";
2
+ import { Cycle, DEFAULT_CYCLE_UNIT, cycle } from "./cycle.mjs";
3
+ import { balanceHalf, combineHalves, halfToString, halfToUnicode, ionicToString, ionicToUnicode, oxidationChange, oxidationNumbers, parseSpecies, speciesToUnicode } from "./redox.mjs";
4
+ import { AVOGADRO, LIGANDS, LIGHT_SPEED, PLANCK, bondAngle, complexCharge, complexFormula, coordinationNumber, geometryOf, observedColour, splittingEnergy, splittingEnergyPerMole, stereoisomers, wavelengthFor } from "./complex.mjs";
5
+ import { REAGENTS, hazardSentence, hazardSentences, isGenericPrecaution, reagentById, reagentsWith, worstHazard } from "./hazard.mjs";
6
+ import { GROUP_LABELS, GROUP_NODES, ROUTE_EDGES, allRoutes, chainChangingEdges, edgeBetween, edgesAlong, edgesFrom, findRoute, shortestSteps } from "./synthesis.mjs";
7
+ import { MULTIPLICITY_NAMES, SHIFT_RANGES, afterD2O, integrationRatio, linePositions, multiplicityOf, predictNmr, splittingPattern } from "./nmr.mjs";
8
+ import { ATOMIC_MASS, atomCounts, bondOrderSum, bondsAt, carbonCount, chargedValence, degreesOfUnsaturation, formatCounts, implicitHydrogens, molecularFormula, neighbours, otherEnd, parseSmiles, relativeMass, ringCount, totalCharge } from "./molecule.mjs";
9
+ import { backboneOf, longestChain, ringSystems } from "./skeleton.mjs";
10
+ import { freeDirection, freeDirections, layout, layoutOf, ringCentre } from "./layout.mjs";
11
+ import { functionalGroups, groupKinds, hasGroup } from "./functional-groups.mjs";
12
+ import { addition, canSustainChain, chainMass, condensation, unitsInChain } from "./polymer.mjs";
13
+ import { identify, resolvedBy, retentionFactor, spotDistance, unresolvedPairs } from "./chromatography.mjs";
14
+ import { empiricalFormula, formatFormula, molarMass, molecularFormulaFor, parseFormula, percentComposition, unitsInMolecule } from "./formula.mjs";
15
+ import { formatCentre, parseCentre, readFormula } from "./species.mjs";
16
+ import { atomTally, balance, chargeTally, formatEquation, splitEquation } from "./equation.mjs";
17
+ import { compareBranches, comparePriority, maximumStereoisomers, rankSubstituents, stereocentres, stereogenicDoubleBonds, stereoisomerCount } from "./stereo.mjs";
18
+ import { SOLUBILITY_PRODUCTS, ionicProduct, kspComparisonMisleads, kspFromSolubility, moreSoluble, saltByFormula, solubilityFromKsp, solubilityWithCommonIon, willPrecipitate } from "./solution.mjs";
19
+ import { ANIONS, CATIONS, IONS, assessCounts, compoundOf, ionByName, ionicCompound, neutralRatio, writeIon } from "./ionic.mjs";
20
+ import { CONSTANTS, DERIVATIONS, absorbanceFromIntensity, beerLambert, combinedGasLaw, concentration, density, dilution, heatEnergy, idealGas, kelvinFrom, massForSolution, molality, molesFromGasVolume, molesFromMass, molesFromParticles, molesFromSolution } from "./relations.mjs";
21
+ import { amountNeeded, apparentYield, molesOf, percentageYield, react, theoreticalYield } from "./stoichiometry.mjs";
22
+ import { lewisCount, octetStatus, valenceElectronsFor } from "./lewis.mjs";
23
+ import { S_P_MIXING_NOTE, diatomic, fillOrbitals, formatOccupancy, orbitalSequence } from "./molecular-orbital.mjs";
24
+ import { OBSERVED_ANGLES, angleBetween, directionsFor, placeLonePairs, shapeOf } from "./vsepr.mjs";
25
+
1
26
  //#region src/chem/index.ts
2
27
  /**
3
- * `chem`, acid–base / pH AND electrochemistry / Nernst, as a PURE kernel (no
4
- * React, no pixels). The engine behind titration curves, pH problems, and galvanic
5
- * cells.
28
+ * `chem`, acid–base / pH and chemical kinetics, as a PURE kernel (no React, no
29
+ * pixels). The engine behind titration curves, pH problems and rate laws.
30
+ *
31
+ * This header used to claim electrochemistry as well, and for a while that was one
32
+ * function taking standard electrode potentials it did not hold. Electrochemistry
33
+ * is now its own subpath, `@classytic/stage/electro`, with the series, electrolysis,
34
+ * Faraday's laws and conductivity in it.
6
35
  *
7
36
  * pH at any point is found by solving the exact charge balance for [H⁺] = h:
8
37
  *
@@ -60,32 +89,9 @@ function titrationCurve(spec, n = 160, span = 2) {
60
89
  };
61
90
  }
62
91
  /** Universal gas constant, J/(mol·K). */
63
- const R = 8.314462618;
64
- /** Faraday constant, C/mol. */
65
- const F = 96485.332;
92
+ const R = GAS_CONSTANT;
66
93
  /** Standard temperature, K (25 °C). */
67
94
  const T_STD = 298.15;
68
- const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
69
- const lcm = (a, b) => a * b / gcd(a, b);
70
- /** Galvanic cell from two half-cells; cathode/anode assigned by standard potential. */
71
- function galvanicCell(x, y, T = T_STD) {
72
- const xIsCathode = x.E0 > y.E0 || x.E0 === y.E0 && x.conc >= y.conc;
73
- const cathode = xIsCathode ? x : y;
74
- const anode = xIsCathode ? y : x;
75
- const E0cell = cathode.E0 - anode.E0;
76
- const n = lcm(anode.z, cathode.z);
77
- const Q = Math.pow(anode.conc, n / anode.z) / Math.pow(cathode.conc, n / cathode.z);
78
- const E = E0cell - R * T / (n * F) * Math.log(Q);
79
- return {
80
- cathode,
81
- anode,
82
- E0cell,
83
- n,
84
- Q,
85
- E,
86
- spontaneous: E > 0
87
- };
88
- }
89
95
  /** Arrhenius rate constant k = A·e^(−Ea/RT). */
90
96
  function arrhenius(A, Ea, T) {
91
97
  return A * Math.exp(-Ea / (R * T));
@@ -128,4 +134,4 @@ function solveStoichiometry(reactants, products, amountsMol) {
128
134
  }
129
135
 
130
136
  //#endregion
131
- export { F, Kw, R, T_STD, arrhenius, arrheniusRatio, concAt, fractionAboveEa, galvanicCell, halfLife, pHAt, solveStoichiometry, titrationCurve };
137
+ export { ANIONS, ATOMIC_MASS, AVOGADRO, CATIONS, CONSTANTS, Cycle, DEFAULT_CYCLE_UNIT, DERIVATIONS, GROUP_LABELS, GROUP_NODES, IONS, Kw, LIGANDS, LIGHT_SPEED, MULTIPLICITY_NAMES, OBSERVED_ANGLES, PLANCK, R, REAGENTS, ROUTE_EDGES, SHIFT_RANGES, SOLUBILITY_PRODUCTS, S_P_MIXING_NOTE, T_STD, absorbanceFromIntensity, addition, afterD2O, allRoutes, amountNeeded, angleBetween, apparentYield, arrhenius, arrheniusRatio, assessCounts, atomCounts, atomTally, backboneOf, balance, balanceHalf, beerLambert, bondAngle, bondOrderSum, bondsAt, canSustainChain, carbonCount, chainChangingEdges, chainMass, chargeTally, chargedValence, combineHalves, combinedGasLaw, compareBranches, comparePriority, complexCharge, complexFormula, compoundOf, concAt, concentration, condensation, coordinationNumber, cycle, degreesOfUnsaturation, density, diatomic, dilution, directionsFor, edgeBetween, edgesAlong, edgesFrom, empiricalFormula, fillOrbitals, findRoute, formatCentre, formatCounts, formatEquation, formatFormula, formatOccupancy, fractionAboveEa, freeDirection, freeDirections, functionalGroups, geometryOf, groupKinds, halfLife, halfToString, halfToUnicode, hasGroup, hazardSentence, hazardSentences, heatEnergy, idealGas, identify, implicitHydrogens, integrationRatio, ionByName, ionicCompound, ionicProduct, ionicToString, ionicToUnicode, isGenericPrecaution, kelvinFrom, kspComparisonMisleads, kspFromSolubility, layout, layoutOf, lewisCount, linePositions, longestChain, massForSolution, maximumStereoisomers, molality, molarMass, molecularFormula, molecularFormulaFor, molesFromGasVolume, molesFromMass, molesFromParticles, molesFromSolution, molesOf, moreSoluble, multiplicityOf, neighbours, neutralRatio, observedColour, octetStatus, orbitalSequence, otherEnd, oxidationChange, oxidationNumbers, pHAt, parseCentre, parseFormula, parseSmiles, parseSpecies, percentComposition, percentageYield, placeLonePairs, predictNmr, rankSubstituents, react, readFormula, reagentById, reagentsWith, relativeMass, resolvedBy, retentionFactor, ringCentre, ringCount, ringSystems, saltByFormula, shapeOf, shortestSteps, solubilityFromKsp, solubilityWithCommonIon, solveStoichiometry, speciesToUnicode, splitEquation, splittingEnergy, splittingEnergyPerMole, splittingPattern, spotDistance, stereocentres, stereogenicDoubleBonds, stereoisomerCount, stereoisomers, theoreticalYield, titrationCurve, totalCharge, unitsInChain, unitsInMolecule, unresolvedPairs, valenceElectronsFor, wavelengthFor, willPrecipitate, worstHazard, writeIon };
@@ -0,0 +1,98 @@
1
+ //#region src/chem/ionic.d.ts
2
+ /**
3
+ * Ions, and the formula two of them make.
4
+ *
5
+ * ## The one rule, which is usually taught as a trick
6
+ *
7
+ * "Write the formula of aluminium oxide" is answered in most classrooms by the crossover trick:
8
+ * write the charges, swap them over, drop the signs. It gives Al2O3, and it gives the wrong answer
9
+ * for magnesium oxide, where crossing over 2 and 2 gives Mg2O2 and the compound is MgO. The trick
10
+ * then acquires a patch: "and cancel down if you can".
11
+ *
12
+ * There is no trick. A compound has no overall charge, so the positive and negative charges in it
13
+ * must cancel exactly, and the formula is the SMALLEST whole number of each ion that makes them.
14
+ * That is a lowest common multiple, and it gets magnesium oxide right without a patch because the
15
+ * smallest multiple of 2 that is also a multiple of 2 is 2, not 4.
16
+ *
17
+ * {@link neutralRatio} computes it that way, so the reasoning a learner is shown is the reasoning
18
+ * the engine uses.
19
+ *
20
+ * ## Charges are data, and the ones worth knowing are here
21
+ *
22
+ * Which charge an ion carries is not derivable for a transition metal, and only roughly derivable
23
+ * from the group for everything else. So the common ones are listed, with their names, because
24
+ * "what is the formula of iron(III) sulfate" needs both the charge and the fact that sulfate is one
25
+ * unit that keeps its brackets.
26
+ *
27
+ * Pure: no React, no pixels.
28
+ */
29
+ interface Ion {
30
+ /** As written in a formula, without the charge: "SO4", "Al", "NH4". */
31
+ readonly formula: string;
32
+ /** Signed: +3 for aluminium, -2 for sulfate. */
33
+ readonly charge: number;
34
+ /** The name it takes in a compound: "aluminium", "sulfate". */
35
+ readonly name: string;
36
+ /**
37
+ * Whether it is more than one atom, and so needs brackets when there is more than one of it.
38
+ *
39
+ * Ca(NO3)2 needs them and CaCl2 does not, and the difference is exactly this. Without brackets
40
+ * the formula reads as one nitrogen and thirty-two oxygens.
41
+ */
42
+ readonly polyatomic: boolean;
43
+ }
44
+ /** The cations a syllabus expects to be known. */
45
+ declare const CATIONS: readonly Ion[];
46
+ /** The anions a syllabus expects to be known. */
47
+ declare const ANIONS: readonly Ion[];
48
+ /** Every ion listed here, cations and anions together. */
49
+ declare const IONS: readonly Ion[];
50
+ /**
51
+ * Find an ion by the name it takes in a compound.
52
+ *
53
+ * Matched case-insensitively on BOTH sides. Lowercasing only the input looked right and failed for
54
+ * every ion whose name carries a Roman numeral, since "iron(iii)" never matches "iron(III)".
55
+ */
56
+ declare const ionByName: (name: string) => Ion | undefined;
57
+ /**
58
+ * How many of each ion make a compound with no overall charge, in the smallest whole numbers.
59
+ *
60
+ * The lowest common multiple of the two charge sizes, divided by each. Magnesium and oxide both
61
+ * carry two, their lowest common multiple is two, and one of each is the answer: MgO. The crossover
62
+ * trick would have given Mg2O2 and needed a separate rule to cancel it down.
63
+ */
64
+ declare function neutralRatio(cationCharge: number, anionCharge: number): [number, number];
65
+ /** One ion written out with its count, bracketed when it needs to be. */
66
+ declare function writeIon(part: Ion, count: number): string;
67
+ interface IonicCompound {
68
+ readonly formula: string;
69
+ readonly name: string;
70
+ readonly cation: Ion;
71
+ readonly anion: Ion;
72
+ readonly cationCount: number;
73
+ readonly anionCount: number;
74
+ }
75
+ /**
76
+ * The compound two ions form.
77
+ *
78
+ * `ionicFormula(aluminium, oxide)` gives Al2O3; `ionicFormula(magnesium, oxide)` gives MgO, not
79
+ * Mg2O2; `ionicFormula(calcium, nitrate)` gives Ca(NO3)2 with the brackets that stop it being read
80
+ * as thirty-two oxygens.
81
+ */
82
+ declare function ionicCompound(cation: Ion, anion: Ion): IonicCompound;
83
+ /** The same, by name: `compoundOf('calcium', 'carbonate')`. */
84
+ declare function compoundOf(cationName: string, anionName: string): IonicCompound;
85
+ /**
86
+ * Whether a proposed pair of counts makes a neutral compound, and whether it is the simplest one.
87
+ *
88
+ * Both answers matter and they are different. Mg2O2 IS neutral and is not a formula anyone writes,
89
+ * so a learner offering it has understood the charge balance and not the "smallest" part, and
90
+ * telling them only that it is wrong would hide which half they have.
91
+ */
92
+ declare function assessCounts(cation: Ion, anion: Ion, cationCount: number, anionCount: number): {
93
+ totalCharge: number;
94
+ neutral: boolean;
95
+ simplest: boolean;
96
+ };
97
+ //#endregion
98
+ export { ANIONS, CATIONS, IONS, Ion, IonicCompound, assessCounts, compoundOf, ionByName, ionicCompound, neutralRatio, writeIon };