From 6ec90aef9a24f2f553f68a149216dcaf4ca44b24 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 7 Mar 2026 21:32:55 +0000 Subject: [PATCH] Add magnetism converters --- calculators_list.md | 60 +++++++++++++++++++++ hdyc-svelte/src/lib/data/calculators.ts | 49 +++++++++++++---- hdyc-svelte/src/lib/data/unitDefinitions.ts | 4 ++ migrate.py | 3 ++ 4 files changed, 107 insertions(+), 9 deletions(-) diff --git a/calculators_list.md b/calculators_list.md index 83f83e1..1454805 100644 --- a/calculators_list.md +++ b/calculators_list.md @@ -1433,6 +1433,24 @@ The registry currently contains 416 unique calculator slugs. | Rømer difference to Newton difference – Multiply Rømer changes by 0.6285714286 for Newton. | romer-difference-to-newton-difference | 0.6285714286 | | Réaumur difference to Rømer difference – Scale Réaumur changes by 0.65625 to align with Rømer. | reaumur-difference-to-romer-difference | 0.65625 | | Rømer difference to Réaumur difference – Rømer increments expand to 1.5238095238 Réaumur degrees. | romer-difference-to-reaumur-difference | 1.5238095238 | +| Thermal expansion coefficient (per °C) to per °K – Convert a metric linear expansion coefficient into a Kelvin-based scale. | thermal-expansion-coefficient-per-c-to-per-k | 1 | +| Thermal expansion coefficient (per °K) to per °C – Return the Kelvin-based expansion coefficient back to per Celsius degree. | thermal-expansion-coefficient-per-k-to-per-c | 1 | +| Thermal expansion coefficient (per °F) to per °R – Imperial expansion coefficients map directly to Rankine increments. | thermal-expansion-coefficient-per-f-to-per-r | 1 | +| Thermal expansion coefficient (per °R) to per °F – Convert Rankine-based coefficients back into per Fahrenheit degree. | thermal-expansion-coefficient-per-r-to-per-f | 1 | +| Thermal resistance (K/W) to m²·K/W – Treat the device-level resistance as per-unit-area metric (equivalent factor). | thermal-resistance-k-per-watt-to-square-meter-k-per-watt | 1 | +| Thermal resistance (m²·K/W) to K/W – Return the area-specific resistance back into the device-level K/W value. | thermal-resistance-square-meter-k-per-watt-to-k-per-watt | 1 | +| Thermal resistance (m²·K/W) to ft²·°F·h/BTU – Express metric resistance per area as an imperial R-value. | thermal-resistance-square-meter-k-per-watt-to-square-foot-hour-fahrenheit-per-btu | 5.678263 | +| Thermal resistance (ft²·°F·h/BTU) to m²·K/W – Convert American R-values into the SI per-area resistance. | thermal-resistance-square-foot-hour-fahrenheit-per-btu-to-square-meter-k-per-watt | 0.176110 | +| Thermal conductivity (W/(m·K)) to cal/(cm·s·°C) – Convert the metric conductivity into cgs units for quick lab references. | thermal-conductivity-w-per-meter-k-to-cal-per-centimeter-second-c | 0.002389 | +| Thermal conductivity (cal/(cm·s·°C)) to W/(m·K) – Translate the cgs conductivity back into the SI form. | thermal-conductivity-cal-per-centimeter-second-c-to-w-per-meter-k | 418.4 | +| Specific heat capacity (J/(kg·K)) to kJ/(kg·K) – Scale the SI heat capacity into kilojoules for engineering readouts. | specific-heat-j-per-kg-k-to-kj-per-kg-k | 0.001 | +| Specific heat capacity (kJ/(kg·K)) to J/(kg·K) – Return kilojoules per kilogram into joules per kilogram. | specific-heat-kj-per-kg-k-to-j-per-kg-k | 1000 | +| Volumetric heat capacity (J/(m³·K)) to kJ/(m³·K) – Express heat density using kilojoules per cubic meter. | volumetric-heat-capacity-j-per-cubic-meter-k-to-kj-per-cubic-meter-k | 0.001 | +| Volumetric heat capacity (kJ/(m³·K)) to J/(m³·K) – Convert the kilojoule-based heat density back into joules. | volumetric-heat-capacity-kj-per-cubic-meter-k-to-j-per-cubic-meter-k | 1000 | +| Heat flux density (W/m²) to W/ft² – Express surface heat flow in imperial area units. | heat-flux-density-w-per-square-meter-to-w-per-square-foot | 0.092903 | +| Heat flux density (W/ft²) to W/m² – Return the imperial flux back into SI. | heat-flux-density-w-per-square-foot-to-w-per-square-meter | 10.7639 | +| Heat transfer coefficient (W/(m²·K)) to W/(ft²·°F) – Convert SI conductance into imperial units per area and degree. | heat-transfer-coefficient-w-per-square-meter-k-to-w-per-square-foot-f | 0.05144 | +| Heat transfer coefficient (W/(ft²·°F)) to W/(m²·K) – Turn imperial film coefficients back into SI. | heat-transfer-coefficient-w-per-square-foot-f-to-w-per-square-meter-k | 19.374 | | Sievert to Gray – Convert sievert exposures into energy-absorption grays for gamma/beta radiation. | sievert-to-gray | 1 | | Smoots to Meters – Translate historic smoot measurements into meters for consistent distances. | smoots-to-meters | 1.7018 | | Solar luminosities to Watts – Express a star’s luminosity in watts for energy output comparisons. | solar-luminosities-to-watts | 3.828e26 | @@ -1458,6 +1476,18 @@ The registry currently contains 416 unique calculator slugs. | Speed Of Light (c) to Miles Per Hour – Express c in miles per hour for familiar velocity comparisons. | speed-of-light-c-to-miles-per-hour | 670616629.384 | | Speed Of Light (c) to Speed Of Light – Reference the c constant as itself. | speed-of-light-c-to-speed-of-light | 1 | | Speed Of Light (c) to Yards Per Second – Show c as yards per second for track-level perspective. | speed-of-light-c-to-yards-per-second | 327857018.81 | +| Ampere-turns to Gilberts – Convert SI magnetomotive force into the CGS gilbert unit used for coils. | ampere-turns-to-gilberts | 0.7957747155 | +| Gilberts to Ampere-turns – Translate the historical gilbert into modern ampere-turns. | gilberts-to-ampere-turns | 1.2566370614 | +| Ampere per meter to Oersted – Express magnetic field strength in CGS oersteds. | ampere-per-meter-to-oersted | 0.0125663706 | +| Oersted to Ampere per meter – Bring Oersted readings into SI amperes per meter. | oersted-to-ampere-per-meter | 79.577471546 | +| Weber to Maxwell – Translate SI magnetic flux into cgs maxwells. | weber-to-maxwell | 1e8 | +| Maxwell to Weber – Return century-old maxwell flux back into webers. | maxwell-to-weber | 1e-8 | +| Tesla to Gauss – Express magnetic flux density in gauss when referencing laboratory magnets. | tesla-to-gauss | 10000 | +| Gauss to Tesla – Turn gauss into tesla for SI calculations. | gauss-to-tesla | 0.0001 | +| Tesla to Millitesla – Use the millitesla scale for engineering magnets. | tesla-to-millitesla | 1000 | +| Millitesla to Tesla – Convert millitesla readings back into tesla. | millitesla-to-tesla | 0.001 | +| Tesla to Kilogauss – Translate tesla directly to kilogauss for chart comparisons. | tesla-to-kilogauss | 10 | +| Kilogauss to Tesla – Return kilogauss values back into tesla. | kilogauss-to-tesla | 0.1 | | Speed Of Light to Centimeters Per Second – Express the speed of light as centimeters per second. | speed-of-light-to-centimeters-per-second | 29979245800 | | Speed Of Light to Cm Per Second – Alias referencing cm/s for the same throughput. | speed-of-light-to-cm-per-second | 29979245800 | | Speed Of Light to Feet Per Second – Show c in feet per second for mechanical intuition. | speed-of-light-to-feet-per-second | 983571056.43 | @@ -2656,6 +2686,36 @@ The registry currently contains 416 unique calculator slugs. - [ ] Heat flux density (BTU/(hr·ft²)) to W/m² (`heat-flux-density-btu-per-hour-square-foot-to-w-per-square-meter`) - [ ] Heat transfer coefficient (W/(m²·K)) to BTU/(hr·ft²·°F) (`heat-transfer-coefficient-w-per-square-meter-k-to-btu-per-hour-square-foot-f`) - [ ] Heat transfer coefficient (BTU/(hr·ft²·°F)) to W/(m²·K) (`heat-transfer-coefficient-btu-per-hour-square-foot-f-to-w-per-square-meter-k`) +- [ ] Thermal expansion coefficient (per °C) to per °K (`thermal-expansion-coefficient-per-c-to-per-k`) +- [ ] Thermal expansion coefficient (per °K) to per °C (`thermal-expansion-coefficient-per-k-to-per-c`) +- [ ] Thermal expansion coefficient (per °F) to per °R (`thermal-expansion-coefficient-per-f-to-per-r`) +- [ ] Thermal expansion coefficient (per °R) to per °F (`thermal-expansion-coefficient-per-r-to-per-f`) +- [ ] Thermal resistance (K/W) to m²·K/W (`thermal-resistance-k-per-watt-to-square-meter-k-per-watt`) +- [ ] Thermal resistance (m²·K/W) to K/W (`thermal-resistance-square-meter-k-per-watt-to-k-per-watt`) +- [ ] Thermal resistance (m²·K/W) to ft²·°F·h/BTU (`thermal-resistance-square-meter-k-per-watt-to-square-foot-hour-fahrenheit-per-btu`) +- [ ] Thermal resistance (ft²·°F·h/BTU) to m²·K/W (`thermal-resistance-square-foot-hour-fahrenheit-per-btu-to-square-meter-k-per-watt`) +- [ ] Thermal conductivity (W/(m·K)) to cal/(cm·s·°C) (`thermal-conductivity-w-per-meter-k-to-cal-per-centimeter-second-c`) +- [ ] Thermal conductivity (cal/(cm·s·°C)) to W/(m·K) (`thermal-conductivity-cal-per-centimeter-second-c-to-w-per-meter-k`) +- [ ] Specific heat capacity (J/(kg·K)) to kJ/(kg·K) (`specific-heat-j-per-kg-k-to-kj-per-kg-k`) +- [ ] Specific heat capacity (kJ/(kg·K)) to J/(kg·K) (`specific-heat-kj-per-kg-k-to-j-per-kg-k`) +- [ ] Volumetric heat capacity (J/(m³·K)) to kJ/(m³·K) (`volumetric-heat-capacity-j-per-cubic-meter-k-to-kj-per-cubic-meter-k`) +- [ ] Volumetric heat capacity (kJ/(m³·K)) to J/(m³·K) (`volumetric-heat-capacity-kj-per-cubic-meter-k-to-j-per-cubic-meter-k`) +- [ ] Heat flux density (W/m²) to W/ft² (`heat-flux-density-w-per-square-meter-to-w-per-square-foot`) +- [ ] Heat flux density (W/ft²) to W/m² (`heat-flux-density-w-per-square-foot-to-w-per-square-meter`) +- [ ] Heat transfer coefficient (W/(m²·K)) to W/(ft²·°F) (`heat-transfer-coefficient-w-per-square-meter-k-to-w-per-square-foot-f`) +- [ ] Heat transfer coefficient (W/(ft²·°F)) to W/(m²·K) (`heat-transfer-coefficient-w-per-square-foot-f-to-w-per-square-meter-k`) +- [ ] Ampere-turns to Gilberts (`ampere-turns-to-gilberts`) +- [ ] Gilberts to Ampere-turns (`gilberts-to-ampere-turns`) +- [ ] Ampere per meter to Oersted (`ampere-per-meter-to-oersted`) +- [ ] Oersted to Ampere per meter (`oersted-to-ampere-per-meter`) +- [ ] Weber to Maxwell (`weber-to-maxwell`) +- [ ] Maxwell to Weber (`maxwell-to-weber`) +- [ ] Tesla to Gauss (`tesla-to-gauss`) +- [ ] Gauss to Tesla (`gauss-to-tesla`) +- [ ] Tesla to Millitesla (`tesla-to-millitesla`) +- [ ] Millitesla to Tesla (`millitesla-to-tesla`) +- [ ] Tesla to Kilogauss (`tesla-to-kilogauss`) +- [ ] Kilogauss to Tesla (`kilogauss-to-tesla`) - [x] Centigrams to Milligrams - [x] Centiliters to Milliliters - [x] Centimeters to Cubits diff --git a/hdyc-svelte/src/lib/data/calculators.ts b/hdyc-svelte/src/lib/data/calculators.ts index 7f701fb..3884f1f 100644 --- a/hdyc-svelte/src/lib/data/calculators.ts +++ b/hdyc-svelte/src/lib/data/calculators.ts @@ -25,6 +25,7 @@ export const categories: Record = { speed: { label: 'Speed / Velocity', icon: '💨' }, pressure: { label: 'Pressure', icon: '🔽' }, energy: { label: 'Energy', icon: '⚡' }, + magnetism: { label: 'Magnetism', icon: '🧲' }, power: { label: 'Power', icon: '🔌' }, data: { label: 'Data Storage', icon: '💾' }, time: { label: 'Time', icon: '⏱️' }, @@ -151,12 +152,12 @@ export const calculators: CalculatorDef[] = [ {"slug": "ampere-turns-per-meter-to-tesla", "name": "Ampere-turns per meter to Tesla", "category": "length", "type": "3col", "teaser": "Rephrase magnetomotive force per meter into tesla when permeability or flux is supplied.", "labels": {"in1": "Ampere-turns per meter", "in2": "Tesla", "in3": "Result"}}, {"slug": "ampere-turns-per-meter-to-weber", "name": "Ampere-turns per meter to Weber", "category": "length", "type": "3col", "teaser": "Relate magnetomotive force per meter to webers of flux when the enclosed area is part of the equation.", "labels": {"in1": "Ampere-turns per meter", "in2": "Weber", "in3": "Result"}}, {"slug": "oersted-to-ampere-turns-per-meter", "name": "Oersted to Ampere-turns per meter", "category": "length", "type": "standard", "teaser": "Flip the CGS oersted field scale back into ampere-turns per meter.", "labels": {"in1": "Oersted", "in2": "Ampere-turns per meter"}, "factor": 79.57747154594767}, - {"slug": "tesla-to-gauss", "name": "Tesla to Gauss", "category": "other", "type": "standard", "teaser": "Express teslas as gauss for high-field comparisons.", "labels": {"in1": "Tesla", "in2": "Gauss"}, "factor": 10000.0}, - {"slug": "tesla-to-milligauss", "name": "Tesla to Milligauss", "category": "angle", "type": "standard", "teaser": "Convert teslas down into milligauss units.", "labels": {"in1": "Tesla", "in2": "Milligauss"}, "factor": 10000000.0}, - {"slug": "tesla-to-millitesla", "name": "Tesla to Millitesla", "category": "angle", "type": "standard", "teaser": "Translate teslas into milliteslas for electronics.", "labels": {"in1": "Tesla", "in2": "Millitesla"}, "factor": 1000.0}, + {"slug": "tesla-to-gauss", "name": "Tesla to Gauss", "category": "magnetism", "type": "standard", "teaser": "Express teslas as gauss for high-field comparisons.", "labels": {"in1": "Tesla", "in2": "Gauss"}, "factor": 10000.0}, + {"slug": "tesla-to-milligauss", "name": "Tesla to Milligauss", "category": "magnetism", "type": "standard", "teaser": "Convert teslas down into milligauss units.", "labels": {"in1": "Tesla", "in2": "Milligauss"}, "factor": 10000000.0}, + {"slug": "tesla-to-millitesla", "name": "Tesla to Millitesla", "category": "magnetism", "type": "standard", "teaser": "Translate teslas into milliteslas for electronics.", "labels": {"in1": "Tesla", "in2": "Millitesla"}, "factor": 1000.0}, {"slug": "tesla-to-ampere-turns-per-meter", "name": "Tesla to Ampere-turns per meter", "category": "length", "type": "3col", "teaser": "Translate flux density into magnetomotive force per meter when vacuum permeability is provided.", "labels": {"in1": "Tesla", "in2": "Ampere-turns per meter", "in3": "Result"}, "hidden": true}, - {"slug": "tesla-to-maxwell", "name": "Tesla to Maxwell", "category": "other", "type": "3col", "teaser": "Convert tesla values into maxwell flux when area or length units are entered.", "labels": {"in1": "Tesla", "in2": "Maxwell", "in3": "Result"}}, - {"slug": "tesla-to-oersted", "name": "Tesla to Oersted", "category": "other", "type": "3col", "teaser": "Rephrase teslas as oersteds by leveraging the vacuum field relationship.", "labels": {"in1": "Tesla", "in2": "Oersted", "in3": "Result"}}, + {"slug": "tesla-to-maxwell", "name": "Tesla to Maxwell", "category": "magnetism", "type": "3col", "teaser": "Convert tesla values into maxwell flux when area or length units are entered.", "labels": {"in1": "Tesla", "in2": "Maxwell", "in3": "Result"}}, + {"slug": "tesla-to-oersted", "name": "Tesla to Oersted", "category": "magnetism", "type": "3col", "teaser": "Rephrase teslas as oersteds by leveraging the vacuum field relationship.", "labels": {"in1": "Tesla", "in2": "Oersted", "in3": "Result"}}, {"slug": "amps-to-milliamps", "name": "Amps to Milliamps", "category": "angle", "type": "standard", "teaser": "Translate amperes into milliamperes when tuning circuit currents.", "labels": {"in1": "Amps", "in2": "Milliamps"}, "factor": 1000.0}, {"slug": "carats-to-grams", "name": "Carats to Grams", "category": "weight", "type": "standard", "labels": {"in1": "Carats", "in2": "Grams"}, "factor": 0.2, "hidden": true}, {"slug": "celsius-to-fahrenheit", "name": "Celsius to Fahrenheit", "category": "temperature", "type": "standard", "labels": {"in1": "Celsius", "in2": "Fahrenheit"}, "factor": 1.8, "offset": 32.0}, @@ -491,7 +492,7 @@ export const calculators: CalculatorDef[] = [ {"slug": "millimeters-to-microns", "name": "Millimeters to Microns", "category": "length", "type": "standard", "labels": {"in1": "Millimeters", "in2": "Microns"}, "factor": 1000.0}, {"slug": "femtograms-to-attograms", "name": "Femtograms to Attograms", "category": "weight", "type": "standard", "labels": {"in1": "Femtograms", "in2": "Attograms"}, "factor": 1000.0}, {"slug": "gigabytes-to-terabytes", "name": "Gigabytes to Terabytes", "category": "data", "type": "standard", "labels": {"in1": "Gigabytes", "in2": "Terabytes"}, "factor": 0.001, "hidden": true}, - {"slug": "maxwell-to-weber", "name": "Maxwell to Weber", "category": "other", "type": "standard", "teaser": "Convert CGS magnetic flux (maxwell) into SI webers.", "labels": {"in1": "Maxwell", "in2": "Weber"}, "factor": 1e-08, "hidden": true}, + {"slug": "maxwell-to-weber", "name": "Maxwell to Weber", "category": "magnetism", "type": "standard", "teaser": "Convert CGS magnetic flux (maxwell) into SI webers.", "labels": {"in1": "Maxwell", "in2": "Weber"}, "factor": 1e-08, "hidden": true}, {"slug": "mbps-to-gbps", "name": "Mbps to Gbps", "category": "other", "type": "standard", "teaser": "Convert megabits per second into gigabits per second.", "labels": {"in1": "Mbps", "in2": "Gbps"}, "factor": 0.001, "hidden": true}, {"slug": "mbps-to-kbps", "name": "Mbps to Kbps", "category": "other", "type": "standard", "teaser": "Convert megabits per second into kilobits per second.", "labels": {"in1": "Mbps", "in2": "Kbps"}, "factor": 1000.0}, {"slug": "mbps-to-mb-per-second", "name": "Mbps to MB/s", "category": "other", "type": "standard", "teaser": "Convert megabits per second into megabytes per second.", "labels": {"in1": "Mbps", "in2": "MB/s"}, "factor": 0.125}, @@ -1021,8 +1022,8 @@ export const calculators: CalculatorDef[] = [ {"slug": "gallons-to-pints", "name": "Gallons to Pints", "category": "volume", "type": "standard", "teaser": "Pouring one gallon equals how many pints for serving?", "labels": {"in1": "Gallons", "in2": "Pints"}, "factor": 8.0}, {"slug": "gallons-to-quarts", "name": "Gallons to Quarts", "category": "volume", "type": "standard", "teaser": "Four gallons convert to how many quarts for canning?", "labels": {"in1": "Gallons", "in2": "Quarts"}, "factor": 4.0}, {"slug": "gamma-mass-to-micrograms", "name": "Gamma (mass) to Micrograms", "category": "weight", "type": "standard", "teaser": "A lab note shows gamma units; what is that in micrograms?", "labels": {"in1": "Gamma (mass)", "in2": "Micrograms"}}, - {"slug": "gauss-to-tesla", "name": "Gauss to Tesla", "category": "other", "type": "standard", "teaser": "A field reads five thousand gauss; what is that in tesla?", "labels": {"in1": "Gauss", "in2": "Tesla"}, "factor": 0.0001, "hidden": true}, - {"slug": "millitesla-to-tesla", "name": "Millitesla to Tesla", "category": "angle", "type": "standard", "teaser": "Convert milliteslas into teslas for electromagnetism work.", "labels": {"in1": "Millitesla", "in2": "Tesla"}, "factor": 0.001, "hidden": true}, + {"slug": "gauss-to-tesla", "name": "Gauss to Tesla", "category": "magnetism", "type": "standard", "teaser": "A field reads five thousand gauss; what is that in tesla?", "labels": {"in1": "Gauss", "in2": "Tesla"}, "factor": 0.0001, "hidden": true}, + {"slug": "millitesla-to-tesla", "name": "Millitesla to Tesla", "category": "magnetism", "type": "standard", "teaser": "Convert milliteslas into teslas for electromagnetism work.", "labels": {"in1": "Millitesla", "in2": "Tesla"}, "factor": 0.001, "hidden": true}, {"slug": "gbps-to-mbps", "name": "Gbps to Mbps", "category": "other", "type": "standard", "teaser": "A fiber uplink reports 10 Gbps; how many megabits per second of capacity is that?", "labels": {"in1": "Gbps", "in2": "Mbps"}, "factor": 1000.0}, {"slug": "gibibytes-to-gigabytes", "name": "Gibibytes to Gigabytes", "category": "data", "type": "standard", "teaser": "A backup file is 2 GiB; how many gigabytes will the storage quota show?", "labels": {"in1": "Gibibytes", "in2": "Gigabytes"}, "factor": 1.073741824}, {"slug": "gigabits-to-megabits", "name": "Gigabits to Megabits", "category": "data", "type": "standard", "teaser": "A carrier promises 3 gigabits per second; how many megabits is the link rated for?", "labels": {"in1": "Gigabits", "in2": "Megabits"}, "factor": 1000.0}, @@ -1464,6 +1465,24 @@ export const calculators: CalculatorDef[] = [ {"slug": "romer-difference-to-newton-difference", "name": "R\u00f8mer difference to Newton difference", "category": "force", "type": "standard", "teaser": "Multiply R\u00f8mer changes by 0.6285714286 for Newton.", "labels": {"in1": "R\u00f8mer difference", "in2": "Newton difference"}, "factor": 0.6285714286}, {"slug": "reaumur-difference-to-romer-difference", "name": "R\u00e9aumur difference to R\u00f8mer difference", "category": "temperature", "type": "standard", "teaser": "Scale R\u00e9aumur changes by 0.65625 to align with R\u00f8mer.", "labels": {"in1": "R\u00e9aumur difference", "in2": "R\u00f8mer difference"}, "factor": 0.65625}, {"slug": "romer-difference-to-reaumur-difference", "name": "R\u00f8mer difference to R\u00e9aumur difference", "category": "temperature", "type": "standard", "teaser": "R\u00f8mer increments expand to 1.5238095238 R\u00e9aumur degrees.", "labels": {"in1": "R\u00f8mer difference", "in2": "R\u00e9aumur difference"}, "factor": 1.5238095238}, + {"slug": "thermal-expansion-coefficient-per-c-to-per-k", "name": "Thermal expansion coefficient (per \u00b0C) to per \u00b0K", "category": "speed", "type": "standard", "teaser": "Convert a metric linear expansion coefficient into a Kelvin-based scale.", "labels": {"in1": "Thermal expansion coefficient (per \u00b0C)", "in2": "per \u00b0K"}}, + {"slug": "thermal-expansion-coefficient-per-k-to-per-c", "name": "Thermal expansion coefficient (per \u00b0K) to per \u00b0C", "category": "speed", "type": "standard", "teaser": "Return the Kelvin-based expansion coefficient back to per Celsius degree.", "labels": {"in1": "Thermal expansion coefficient (per \u00b0K)", "in2": "per \u00b0C"}}, + {"slug": "thermal-expansion-coefficient-per-f-to-per-r", "name": "Thermal expansion coefficient (per \u00b0F) to per \u00b0R", "category": "speed", "type": "standard", "teaser": "Imperial expansion coefficients map directly to Rankine increments.", "labels": {"in1": "Thermal expansion coefficient (per \u00b0F)", "in2": "per \u00b0R"}}, + {"slug": "thermal-expansion-coefficient-per-r-to-per-f", "name": "Thermal expansion coefficient (per \u00b0R) to per \u00b0F", "category": "speed", "type": "standard", "teaser": "Convert Rankine-based coefficients back into per Fahrenheit degree.", "labels": {"in1": "Thermal expansion coefficient (per \u00b0R)", "in2": "per \u00b0F"}}, + {"slug": "thermal-resistance-k-per-watt-to-square-meter-k-per-watt", "name": "Thermal resistance (K/W) to m\u00b2\u00b7K/W", "category": "energy", "type": "standard", "teaser": "Treat the device-level resistance as per-unit-area metric (equivalent factor).", "labels": {"in1": "Thermal resistance (K/W)", "in2": "m\u00b2\u00b7K/W"}}, + {"slug": "thermal-resistance-square-meter-k-per-watt-to-k-per-watt", "name": "Thermal resistance (m\u00b2\u00b7K/W) to K/W", "category": "energy", "type": "standard", "teaser": "Return the area-specific resistance back into the device-level K/W value.", "labels": {"in1": "Thermal resistance (m\u00b2\u00b7K/W)", "in2": "K/W"}}, + {"slug": "thermal-resistance-square-meter-k-per-watt-to-square-foot-hour-fahrenheit-per-btu", "name": "Thermal resistance (m\u00b2\u00b7K/W) to ft\u00b2\u00b7\u00b0F\u00b7h/BTU", "category": "energy", "type": "standard", "teaser": "Express metric resistance per area as an imperial R-value.", "labels": {"in1": "Thermal resistance (m\u00b2\u00b7K/W)", "in2": "ft\u00b2\u00b7\u00b0F\u00b7h/BTU"}, "factor": 5.678263}, + {"slug": "thermal-resistance-square-foot-hour-fahrenheit-per-btu-to-square-meter-k-per-watt", "name": "Thermal resistance (ft\u00b2\u00b7\u00b0F\u00b7h/BTU) to m\u00b2\u00b7K/W", "category": "energy", "type": "standard", "teaser": "Convert American R-values into the SI per-area resistance.", "labels": {"in1": "Thermal resistance (ft\u00b2\u00b7\u00b0F\u00b7h/BTU)", "in2": "m\u00b2\u00b7K/W"}, "factor": 0.17611}, + {"slug": "thermal-conductivity-w-per-meter-k-to-cal-per-centimeter-second-c", "name": "Thermal conductivity (W/(m\u00b7K)) to cal/(cm\u00b7s\u00b7\u00b0C)", "category": "energy", "type": "standard", "teaser": "Convert the metric conductivity into cgs units for quick lab references.", "labels": {"in1": "Thermal conductivity (W/(m\u00b7K))", "in2": "cal/(cm\u00b7s\u00b7\u00b0C)"}, "factor": 0.002389}, + {"slug": "thermal-conductivity-cal-per-centimeter-second-c-to-w-per-meter-k", "name": "Thermal conductivity (cal/(cm\u00b7s\u00b7\u00b0C)) to W/(m\u00b7K)", "category": "energy", "type": "standard", "teaser": "Translate the cgs conductivity back into the SI form.", "labels": {"in1": "Thermal conductivity (cal/(cm\u00b7s\u00b7\u00b0C))", "in2": "W/(m\u00b7K)"}, "factor": 418.4}, + {"slug": "specific-heat-j-per-kg-k-to-kj-per-kg-k", "name": "Specific heat capacity (J/(kg\u00b7K)) to kJ/(kg\u00b7K)", "category": "temperature", "type": "standard", "teaser": "Scale the SI heat capacity into kilojoules for engineering readouts.", "labels": {"in1": "Specific heat capacity (J/(kg\u00b7K))", "in2": "kJ/(kg\u00b7K)"}, "factor": 0.001}, + {"slug": "specific-heat-kj-per-kg-k-to-j-per-kg-k", "name": "Specific heat capacity (kJ/(kg\u00b7K)) to J/(kg\u00b7K)", "category": "temperature", "type": "standard", "teaser": "Return kilojoules per kilogram into joules per kilogram.", "labels": {"in1": "Specific heat capacity (kJ/(kg\u00b7K))", "in2": "J/(kg\u00b7K)"}, "factor": 1000.0}, + {"slug": "volumetric-heat-capacity-j-per-cubic-meter-k-to-kj-per-cubic-meter-k", "name": "Volumetric heat capacity (J/(m\u00b3\u00b7K)) to kJ/(m\u00b3\u00b7K)", "category": "temperature", "type": "standard", "teaser": "Express heat density using kilojoules per cubic meter.", "labels": {"in1": "Volumetric heat capacity (J/(m\u00b3\u00b7K))", "in2": "kJ/(m\u00b3\u00b7K)"}, "factor": 0.001}, + {"slug": "volumetric-heat-capacity-kj-per-cubic-meter-k-to-j-per-cubic-meter-k", "name": "Volumetric heat capacity (kJ/(m\u00b3\u00b7K)) to J/(m\u00b3\u00b7K)", "category": "temperature", "type": "standard", "teaser": "Convert the kilojoule-based heat density back into joules.", "labels": {"in1": "Volumetric heat capacity (kJ/(m\u00b3\u00b7K))", "in2": "J/(m\u00b3\u00b7K)"}, "factor": 1000.0}, + {"slug": "heat-flux-density-w-per-square-meter-to-w-per-square-foot", "name": "Heat flux density (W/m\u00b2) to W/ft\u00b2", "category": "temperature", "type": "standard", "teaser": "Express surface heat flow in imperial area units.", "labels": {"in1": "Heat flux density (W/m\u00b2)", "in2": "W/ft\u00b2"}, "factor": 0.092903}, + {"slug": "heat-flux-density-w-per-square-foot-to-w-per-square-meter", "name": "Heat flux density (W/ft\u00b2) to W/m\u00b2", "category": "temperature", "type": "standard", "teaser": "Return the imperial flux back into SI.", "labels": {"in1": "Heat flux density (W/ft\u00b2)", "in2": "W/m\u00b2"}, "factor": 10.7639}, + {"slug": "heat-transfer-coefficient-w-per-square-meter-k-to-w-per-square-foot-f", "name": "Heat transfer coefficient (W/(m\u00b2\u00b7K)) to W/(ft\u00b2\u00b7\u00b0F)", "category": "temperature", "type": "standard", "teaser": "Convert SI conductance into imperial units per area and degree.", "labels": {"in1": "Heat transfer coefficient (W/(m\u00b2\u00b7K))", "in2": "W/(ft\u00b2\u00b7\u00b0F)"}, "factor": 0.05144}, + {"slug": "heat-transfer-coefficient-w-per-square-foot-f-to-w-per-square-meter-k", "name": "Heat transfer coefficient (W/(ft\u00b2\u00b7\u00b0F)) to W/(m\u00b2\u00b7K)", "category": "temperature", "type": "standard", "teaser": "Turn imperial film coefficients back into SI.", "labels": {"in1": "Heat transfer coefficient (W/(ft\u00b2\u00b7\u00b0F))", "in2": "W/(m\u00b2\u00b7K)"}, "factor": 19.374}, {"slug": "sievert-to-gray", "name": "Sievert to Gray", "category": "radiation", "type": "standard", "teaser": "Convert sievert exposures into energy-absorption grays for gamma/beta radiation.", "labels": {"in1": "Sievert", "in2": "Gray"}, "hidden": true}, {"slug": "smoots-to-meters", "name": "Smoots to Meters", "category": "length", "type": "standard", "teaser": "Translate historic smoot measurements into meters for consistent distances.", "labels": {"in1": "Smoots", "in2": "Meters"}, "factor": 1.7018}, {"slug": "solar-luminosities-to-watts", "name": "Solar luminosities to Watts", "category": "power", "type": "standard", "teaser": "Express a star\u2019s luminosity in watts for energy output comparisons.", "labels": {"in1": "Solar luminosities", "in2": "Watts"}, "factor": 3.828e+26}, @@ -1489,6 +1508,18 @@ export const calculators: CalculatorDef[] = [ {"slug": "speed-of-light-c-to-miles-per-hour", "name": "Speed Of Light (c) to Miles Per Hour", "category": "length", "type": "standard", "teaser": "Express c in miles per hour for familiar velocity comparisons.", "labels": {"in1": "Speed Of Light (c)", "in2": "Miles Per Hour"}, "factor": 670616629.384}, {"slug": "speed-of-light-c-to-speed-of-light", "name": "Speed Of Light (c) to Speed Of Light", "category": "light", "type": "standard", "teaser": "Reference the c constant as itself.", "labels": {"in1": "Speed Of Light (c)", "in2": "Speed Of Light"}}, {"slug": "speed-of-light-c-to-yards-per-second", "name": "Speed Of Light (c) to Yards Per Second", "category": "length", "type": "standard", "teaser": "Show c as yards per second for track-level perspective.", "labels": {"in1": "Speed Of Light (c)", "in2": "Yards Per Second"}, "factor": 327857018.81}, + {"slug": "ampere-turns-to-gilberts", "name": "Ampere-turns to Gilberts", "category": "magnetism", "type": "standard", "teaser": "Convert SI magnetomotive force into the CGS gilbert unit used for coils.", "labels": {"in1": "Ampere-turns", "in2": "Gilberts"}, "factor": 0.7957747155, "hidden": true}, + {"slug": "gilberts-to-ampere-turns", "name": "Gilberts to Ampere-turns", "category": "magnetism", "type": "standard", "teaser": "Translate the historical gilbert into modern ampere-turns.", "labels": {"in1": "Gilberts", "in2": "Ampere-turns"}, "factor": 1.2566370614}, + {"slug": "ampere-per-meter-to-oersted", "name": "Ampere per meter to Oersted", "category": "length", "type": "standard", "teaser": "Express magnetic field strength in CGS oersteds.", "labels": {"in1": "Ampere per meter", "in2": "Oersted"}, "factor": 0.0125663706, "hidden": true}, + {"slug": "oersted-to-ampere-per-meter", "name": "Oersted to Ampere per meter", "category": "length", "type": "standard", "teaser": "Bring Oersted readings into SI amperes per meter.", "labels": {"in1": "Oersted", "in2": "Ampere per meter"}, "factor": 79.577471546}, + {"slug": "weber-to-maxwell", "name": "Weber to Maxwell", "category": "magnetism", "type": "standard", "teaser": "Translate SI magnetic flux into cgs maxwells.", "labels": {"in1": "Weber", "in2": "Maxwell"}, "factor": 100000000.0}, + {"slug": "maxwell-to-weber", "name": "Maxwell to Weber", "category": "magnetism", "type": "standard", "teaser": "Return century-old maxwell flux back into webers.", "labels": {"in1": "Maxwell", "in2": "Weber"}, "factor": 1e-08, "hidden": true}, + {"slug": "tesla-to-gauss", "name": "Tesla to Gauss", "category": "magnetism", "type": "standard", "teaser": "Express magnetic flux density in gauss when referencing laboratory magnets.", "labels": {"in1": "Tesla", "in2": "Gauss"}, "factor": 10000.0}, + {"slug": "gauss-to-tesla", "name": "Gauss to Tesla", "category": "magnetism", "type": "standard", "teaser": "Turn gauss into tesla for SI calculations.", "labels": {"in1": "Gauss", "in2": "Tesla"}, "factor": 0.0001, "hidden": true}, + {"slug": "tesla-to-millitesla", "name": "Tesla to Millitesla", "category": "magnetism", "type": "standard", "teaser": "Use the millitesla scale for engineering magnets.", "labels": {"in1": "Tesla", "in2": "Millitesla"}, "factor": 1000.0}, + {"slug": "millitesla-to-tesla", "name": "Millitesla to Tesla", "category": "magnetism", "type": "standard", "teaser": "Convert millitesla readings back into tesla.", "labels": {"in1": "Millitesla", "in2": "Tesla"}, "factor": 0.001, "hidden": true}, + {"slug": "tesla-to-kilogauss", "name": "Tesla to Kilogauss", "category": "magnetism", "type": "standard", "teaser": "Translate tesla directly to kilogauss for chart comparisons.", "labels": {"in1": "Tesla", "in2": "Kilogauss"}, "factor": 10.0}, + {"slug": "kilogauss-to-tesla", "name": "Kilogauss to Tesla", "category": "magnetism", "type": "standard", "teaser": "Return kilogauss values back into tesla.", "labels": {"in1": "Kilogauss", "in2": "Tesla"}, "factor": 0.1, "hidden": true}, {"slug": "speed-of-light-to-centimeters-per-second", "name": "Speed Of Light to Centimeters Per Second", "category": "length", "type": "standard", "teaser": "Express the speed of light as centimeters per second.", "labels": {"in1": "Speed Of Light", "in2": "Centimeters Per Second"}, "factor": 29979245800.0}, {"slug": "speed-of-light-to-cm-per-second", "name": "Speed Of Light to Cm Per Second", "category": "speed", "type": "standard", "teaser": "Alias referencing cm/s for the same throughput.", "labels": {"in1": "Speed Of Light", "in2": "Cm Per Second"}, "factor": 29979245800.0}, {"slug": "speed-of-light-to-feet-per-second", "name": "Speed Of Light to Feet Per Second", "category": "length", "type": "standard", "teaser": "Show c in feet per second for mechanical intuition.", "labels": {"in1": "Speed Of Light", "in2": "Feet Per Second"}, "factor": 983571056.43}, @@ -1560,7 +1591,7 @@ export const calculators: CalculatorDef[] = [ {"slug": "watts-to-tons-of-refrigeration", "name": "Watts to Tons Of Refrigeration", "category": "weight", "type": "standard", "teaser": "Translate continuous power into refrigeration tons.", "labels": {"in1": "Watts", "in2": "Tons Of Refrigeration"}, "factor": 0.000284345}, {"slug": "watts-to-watt-hours", "name": "Watts to Watt-hours", "category": "power", "type": "3col", "teaser": "Convert instantaneous power into energy by supplying a time interval.", "labels": {"in1": "Watts", "in2": "Watt-hours", "in3": "Result"}}, {"slug": "watts-to-milliwatts", "name": "Watts to Milliwatts", "category": "power", "type": "standard", "teaser": "Scale watts down to milliwatts.", "labels": {"in1": "Watts", "in2": "Milliwatts"}, "factor": 1000.0}, - {"slug": "weber-to-maxwell", "name": "Weber to Maxwell", "category": "other", "type": "standard", "teaser": "Express webers as maxwells for magnetic flux reports.", "labels": {"in1": "Weber", "in2": "Maxwell"}, "factor": 100000000.0}, + {"slug": "weber-to-maxwell", "name": "Weber to Maxwell", "category": "magnetism", "type": "standard", "teaser": "Express webers as maxwells for magnetic flux reports.", "labels": {"in1": "Weber", "in2": "Maxwell"}, "factor": 100000000.0}, {"slug": "wh-per-km-to-wh-per-mile", "name": "Wh per km to Wh per mile", "category": "length", "type": "standard", "teaser": "Convert EV efficiency from km to mile units.", "labels": {"in1": "Wh per km", "in2": "Wh per mile"}, "factor": 1.609344}, {"slug": "wh-per-mile-to-wh-per-km", "name": "Wh per mile to Wh per km", "category": "length", "type": "standard", "teaser": "Express US efficiency numbers as kilometers-based metrics.", "labels": {"in1": "Wh per mile", "in2": "Wh per km"}, "factor": 0.621371, "hidden": true}, {"slug": "yards-per-second-to-kilometers-per-hour", "name": "Yards per second to Kilometers per hour", "category": "length", "type": "standard", "teaser": "Convert yard/second speeds into km/h for international racing.", "labels": {"in1": "Yards per second", "in2": "Kilometers per hour"}, "factor": 3.29184}, diff --git a/hdyc-svelte/src/lib/data/unitDefinitions.ts b/hdyc-svelte/src/lib/data/unitDefinitions.ts index 768e839..e63bfb1 100644 --- a/hdyc-svelte/src/lib/data/unitDefinitions.ts +++ b/hdyc-svelte/src/lib/data/unitDefinitions.ts @@ -33,6 +33,10 @@ const domainDefinitions: Record = summary: 'represents the capacity to do work or release heat.', context: 'Energy units compare calories, joules, or BTUs when tracking work, heat, or stored energy.', }, + magnetism: { + summary: 'captures magnetic intensity, flux, and field density.', + context: 'Use these units when comparing magnets, coils, or magnetic flux through areas and materials.', + }, power: { summary: 'measures the rate at which energy is transferred or converted.', context: 'Use them to compare engines, appliances, or systems that deliver energy over time.', diff --git a/migrate.py b/migrate.py index d70a1e1..ea2a199 100644 --- a/migrate.py +++ b/migrate.py @@ -67,7 +67,9 @@ def guess_category(name): if any(x in name_l for x in ['liter', 'gallon', 'cup', 'pint', 'quart', 'fluid', 'milliliter', 'spoon', 'drop']): return 'volume' if ' per ' in name_l or 'knot' in name_l or 'mach' in name_l or 'rpm' in name_l: return 'speed' # RPM might be frequency, close enough if any(x in name_l for x in ['pascal', 'bar', 'psi', 'atmosphere', 'mmhg', 'torr', 'water', 'mercury']): return 'pressure' + if any(x in name_l for x in ['magnet', 'magnetic', 'tesla', 'gauss', 'oersted', 'weber', 'maxwell', 'gilbert', 'ampere-turn', 'ampere turns', 'ampere per meter', 'magnetomotive']): return 'magnetism' if any(x in name_l for x in ['joule', 'calorie', 'btu', 'erg', 'therm', 'electron-volt']): return 'energy' + if any(x in name_l for x in ['thermal', 'heat', 'flux', 'conductivity', 'resistance', 'capacity', 'expansion', 'transfer']): return 'temperature' if any(x in name_l for x in ['watt', 'horsepower']): return 'power' if any(x in name_l for x in ['byte', 'bit', 'nibble', 'baud']): return 'data' if 'light' in name_l or any(x in name_l for x in ['lumen', 'lux', 'candela']): return 'light' @@ -307,6 +309,7 @@ export const categories: Record = { speed: { label: 'Speed / Velocity', icon: '💨' }, pressure: { label: 'Pressure', icon: '🔽' }, energy: { label: 'Energy', icon: '⚡' }, + magnetism: { label: 'Magnetism', icon: '🧲' }, power: { label: 'Power', icon: '🔌' }, data: { label: 'Data Storage', icon: '💾' }, time: { label: 'Time', icon: '⏱️' },