Skip to content

Commit

Permalink
Add some units
Browse files Browse the repository at this point in the history
  • Loading branch information
triallax authored and sharkdp committed Jan 2, 2024
1 parent cb1c6be commit 4efd0ea
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
7 changes: 6 additions & 1 deletion book/src/list-units.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
| `Angle` | [Minute of arc](https://en.wikipedia.org/wiki/Minute_and_second_of_arc) | `arcmin`, `arcminute`, `arcminutes` |
| `Angle` | [Second of arc](https://en.wikipedia.org/wiki/Minute_and_second_of_arc) | `arcsec`, `arcsecond`, `arcseconds` |
| `Angle` | [Degree](https://en.wikipedia.org/wiki/Degree_(angle)) | `deg`, `degree`, `degrees`, `°` |
| `Angle` | [Gradian](https://en.wikipedia.org/wiki/Gradian) | `gon` |
| `Angle` | [Gradian](https://en.wikipedia.org/wiki/Gradian) | `gon`, `gons`, `grad`, `grade`, `grades`, `gradian`, `gradians`, `grads` |
| `Angle` | [Radian](https://en.wikipedia.org/wiki/Radian) | `rad`, `radian`, `radians` |
| `Angle` | [Revolution](https://en.wikipedia.org/wiki/Revolution_(unit)) | `rev`, `revolution`, `revolutions` |
| `Angle` | [Turn](https://en.wikipedia.org/wiki/Turn_(geometry)) | `turn`, `turns` |
Expand All @@ -23,6 +23,8 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
| `Area` | [Barn](https://en.wikipedia.org/wiki/Barn_(unit)) | `barn`, `barns` |
| `Area` | [Football field](https://en.wikipedia.org/wiki/Football_pitch) | `footballfield` |
| `Area` | [Hectare](https://en.wikipedia.org/wiki/Hectare) | `ha`, `hectare`, `hectares` |
| `Beat` | [Beat](https://en.wikipedia.org/wiki/Beat_(music)) | `beat`, `beats` |
| `Beat / Time` | [Beats per minute](https://en.wikipedia.org/wiki/Tempo) | `bpm`, `BPM` |
| `Capacitance` | [Farad](https://en.wikipedia.org/wiki/Farad) | `F`, `farad`, `farads` |
| `CatalyticActivity` | [Katal](https://en.wikipedia.org/wiki/Katal) | `kat`, `katal`, `katals` |
| `Current` | [Ampere](https://en.wikipedia.org/wiki/Ampere) | `A`, `ampere`, `amperes` |
Expand Down Expand Up @@ -76,6 +78,7 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
| `Length` | [Nautical Mile](https://en.wikipedia.org/wiki/Nautical_mile) | `nautical_mile`, `nautical_miles`, `NM`, `nmi` |
| `Length` | [Parsec](https://en.wikipedia.org/wiki/Parsec) | `parsec`, `parsecs`, `pc` |
| `Length` | [Planck length](https://en.wikipedia.org/wiki/Planck_length) | `planck_length` |
| `Length` | [Rack unit](https://en.wikipedia.org/wiki/Rack_unit) | `rackunit`, `rackunits`, `RU`, `U` |
| `Length` | [US rod](https://en.wikipedia.org/wiki/Rod_(unit)) | `perch`, `rod`, `rods` |
| `Length` | [Smoot](https://en.wikipedia.org/wiki/Smoot) | `smoot` |
| `Length` | [Stoney length](https://en.wikipedia.org/wiki/Stoney_units) | `stoney_length` |
Expand Down Expand Up @@ -142,7 +145,9 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
| `Pressure` | [Standard atmosphere](https://en.wikipedia.org/wiki/Standard_atmosphere_(unit)) | `atm`, `atmosphere`, `atmospheres` |
| `Pressure` | [Bar](https://en.wikipedia.org/wiki/Bar_(unit)) | `bar`, `bars` |
| `Pressure` | [Inch of mercury](https://en.wikipedia.org/wiki/Inch_of_mercury) | `inHg` |
| `Pressure` | [Kilopound-force per square inch](https://en.wikipedia.org/wiki/Ksi_(unit)) | `ksi`, `KSI` |
| `Pressure` | [Millimeter of mercury](https://en.wikipedia.org/wiki/Millimeter_of_mercury) | `mmHg` |
| `Pressure` | [Megapound-force per square inch](https://en.wikipedia.org/wiki/Ksi_(unit)) | `mpsi`, `MPSI` |
| `Pressure` | [Pascal](https://en.wikipedia.org/wiki/Pascal_(unit)) | `Pa`, `pascal`, `pascals` |
| `Pressure` | [Pound-force per square inch](https://en.wikipedia.org/wiki/Pounds_per_square_inch) | `psi`, `PSI` |
| `Pressure` | [Torr](https://en.wikipedia.org/wiki/Torr) | `torr` |
Expand Down
18 changes: 17 additions & 1 deletion numbat/modules/units/misc.nbt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ unit torr: Pressure = 101325 / 760 × pascal
@aliases(PSI: short)
unit psi: Pressure = 6.894757 kPa

@name("Kilopound-force per square inch")
@url("https://en.wikipedia.org/wiki/Ksi_(unit)")
@aliases(KSI: short)
unit ksi: Pressure = 1000 psi

@name("Megapound-force per square inch")
@url("https://en.wikipedia.org/wiki/Ksi_(unit)")
@aliases(MPSI: short)
unit mpsi: Pressure = 1000000 psi

@name("Standard atmosphere")
@url("https://en.wikipedia.org/wiki/Standard_atmosphere_(unit)")
@aliases(atmospheres, atm: short)
Expand All @@ -100,6 +110,11 @@ unit footballfield: Area = 105 m × 68 m # Standard FIFA football pitch
@url("https://en.wikipedia.org/wiki/Olympic-size_swimming_pool")
unit swimmingpool: Volume = 50 m × 25 m × 2 m # Olympic-size swimming pool (FR3)

@name("Rack unit")
@url("https://en.wikipedia.org/wiki/Rack_unit")
@aliases(rackunits, RU: short, U: short)
unit rackunit: Length = 0.04445 meter

# Angles

@name("Turn")
Expand All @@ -109,7 +124,8 @@ unit turn: Angle = 2 π rad

@name("Gradian")
@url("https://en.wikipedia.org/wiki/Gradian")
unit gon: Angle = 90° / 100
@aliases(gradians, grad, grads, grade, grades, gon, gons)
unit gradian: Angle = 90° / 100

### Abbreviations

Expand Down
12 changes: 12 additions & 0 deletions numbat/modules/units/placeholder.nbt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ unit frame: Frame
@url("https://en.wikipedia.org/wiki/Frame_rate")
unit fps: Frame / Time = frame / second

# Basic unit of time in music
dimension Beat

@name("Beat")
@url("https://en.wikipedia.org/wiki/Beat_(music)")
@aliases(beats)
unit beat: Beat

@name("Beats per minute")
@url("https://en.wikipedia.org/wiki/Tempo")
@aliases(BPM: short)
unit bpm: Beat / Time = beat / minute

# A separate or limited portion or quantity of something
dimension Piece
Expand Down

0 comments on commit 4efd0ea

Please sign in to comment.