Units & Dimensional Analysis
Kalc features a built-in dimensional analysis engine. Rather than treating units as superficial text labels, Kalc models physical quantities as dimensional vectors across 10 fundamental base dimensions, ensuring that unit additions, multiplications, and conversions maintain strict dimensional correctness.
The 10 Base Dimensions
All physical quantities resolve internally to base dimensional units:
| Dimension | Base Unit | Supported Units & Common Aliases |
|---|---|---|
| Length | m (meter) | m, cm, mm, km, inch (in, "), foot (ft, '), yard (yd), mile (mi), nautical mile, pt, mil |
| Area | m2 (sq meter) | sqm (m2), sq cm, sq ft, sq in, sq yd, hectare (ha), acre, sq km, sq mi |
| Volume | m3 (cu meter) | cbm (m3), liter (l, liters), milliliter (ml), pint (pt), quart (qt), gallon (gal), cup, tbsp, tsp, fluid oz (fl oz), cu ft, cu in |
| Mass | g (gram) | gram (g), milligram (mg), kilogram (kg), metric ton (ton, t), ounce (oz), pound (lb, lbs), stone (st) |
| Time | s (second) | second (s, sec), minute (min), hour (h, hr, hrs), day (d), week (w), month (mo, $30.436875\text{ d}$), year (yr, $365\text{ d}$) |
| Data Storage | byte | Decimal SI: bit (b), byte (B), KB, MB, GB, TB, PBBinary IEC: KiB, MiB, GiB, TiB, PiB |
| Data Transfer | bps (bits/sec) | bps, kbps, Mbps, Gbps |
| Temperature | K (Kelvin) | kelvin (K), celsius (°C, C, degC), fahrenheit (°F, F, degF) |
| Screen / CSS | px (pixel) | pixel (px), point (pt), em (defaults: $1\text{ em} = 16\text{ px}$, $\text{ppi} = 96$) |
| Currency | USD | 170+ ISO currencies (USD, EUR, GBP, JPY, etc.) and cryptocurrencies (BTC, ETH, SOL) |
Multi-Part Unit Concatenation
In everyday language, we rarely express measurements as single fractional decimals; we say "5 feet 11 inches" or "1 hour 30 minutes".
Kalc natively supports Multi-Part Unit Concatenation. Adjacent units sharing the same physical dimension automatically combine into a unified sum without requiring explicit + operators:
1 meter 20 cm in inches // 47.24 in
5 feet 11 inches in cm // 180.34 cm
2 hours 30 mins 15 seconds in hours // 2.504167 hours
$5 50 cents in cents // 550 cents
2 gallons 3 quarts 1 pint in liters // 10.88 lUnit Conversions (in, to, ->)
Convert any quantity using in, to, ->, as, or into:
100 km/h in mph // 62.14 mph
2.5 TB in GB // 2,500 GB
2.5 TB in GiB // 2,328.31 GiB
180 lbs in kg // 81.65 kg
15 bar in psi // 217.56 psiIncompatible Dimension Guard
Converting between incompatible physical dimensions is rejected with an inline diagnostic:
50 kg in meters // ⚠️ Cannot convert mass (kg) to length (meter)Data Storage: Decimal (SI) vs. Binary (IEC)
Kalc strictly distinguishes decimal transmission units ($10^3 = 1000$) from binary memory units ($2^{10} = 1024$):
1 GB in MB // 1,000 MB (Decimal SI)
1 GiB in MiB // 1,024 MiB (Binary IEC)
1 GB in GiB // 0.931323 GiBDownload Duration Calculations
Kalc reconciles bits and bytes automatically when computing network transfer times:
time to download 45 GB at 150 Mbps // 40 min
time to download 2.4 TB at 1 Gbps // 5 hr 20 minAffine Temperature Conversions
Temperature conversions between Celsius, Fahrenheit, and Kelvin require both a scale multiplier and an origin offset:
- $T_C = T_K - 273.15$
- $T_F = T_C \times \frac{9}{5} + 32$
Kalc evaluates these exact affine equations:
72 °F in °C // 22.22 °C
0 °C in °F // 32 °F
-40 °C in °F // -40 °F
100 °C in K // 373.15 KScreen & Typography Units
For UI designers and frontend engineers, Kalc bridges CSS and screen typography:
24px in em // 1.5 em (Base 16px)
2.5em in px // 40 px
72pt in px // 96 px (96 ppi)Base em size (default 16px) and display ppi (default 96) can be customized per document or in application preferences.
Disambiguation Rules
To ensure conversational English parses without ambiguity:
in: When followed by a valid unit identifier or radix (in cm,in hex),inacts as the conversion operator. When preceded by a number without a following unit (12 in), it resolves to inches.m: Standalone after a number resolves to meters (10 m). When prepended to metric unit symbols, it acts as the milli- prefix (mg,ml,mm,ms).min: Resolves to minutes (15 min). Usemin(...)with parentheses for the minimum statistical function.
Culinary Ingredient Density Bridging
Kalc embeds a calibrated culinary density table, allowing volume-to-mass conversions for common kitchen ingredients:
250 g butter in cups // 1.1 cup
1 cup flour in grams // 125 g
2 tbsp olive oil in grams // 27.5 gSupported ingredients: butter, flour, sugar, olive oil, milk, water, honey.