Ideal Gas Law API
Ideal-gas-law maths as an API, computed locally and deterministically. The ideal endpoint solves PV = nRT for whichever quantity you leave out: provide any three of pressure, volume, amount of substance (moles) and temperature, and it returns the fourth in several units. The combined endpoint applies the combined gas law, P₁V₁/T₁ = P₂V₂/T₂: give a first state and two quantities of the second state and it finds the missing one — handy for "what happens to the volume if I double the pressure" questions. The density endpoint computes the density of an ideal gas from the pressure, temperature and molar mass (ρ = P·M / R·T). Pressure accepts pascals, kPa, bar, atm, psi, mmHg and Torr; volume accepts m³, litres, mL and cubic feet; temperature accepts kelvin, Celsius and Fahrenheit; and the gas constant R is 8.314462618 J/(mol·K). Everything is computed in SI internally and is instant and private. Ideal for chemistry and physics education, lab and process tools, HVAC and scuba calculations, and engineering software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is ideal-gas thermodynamics; for the chemical elements and periodic-table data use an elements API.
api.oanor.com/gaslaw-api