Skip to content

Commit

Permalink
removed unneeded aliases from units
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam091 committed Nov 3, 2023
1 parent d5912ca commit d9581cb
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 73 deletions.
8 changes: 4 additions & 4 deletions lib/unit_measurements/unit_groups/acceleration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
primitive "m/s²"

system :metric do
unit "m/s²", aliases: ["m/s^2", "m·s⁻²", "meter per second squared", "meters per second squared", "metre per second squared", "metres per second squared"]
unit "m/s²", aliases: ["m/s^2", "meter per second squared", "meters per second squared", "metre per second squared", "metres per second squared"]
end

system :imperial do
unit "in/s²", value: "0.0254 m/s²", aliases: ["in/s^2", "in·s⁻²", "ips²", "inch per second squared", "inches per second squared"]
unit "in/s²", value: "0.0254 m/s²", aliases: ["in/s^2", "ips²", "inch per second squared", "inches per second squared"]
unit "ipm/s", value: "0.0004233333 m/s²", aliases: ["in/(min⋅s)", "inch per minute per second", "inches per minute per second"]
unit "iph/s", value: "7.055555e-6 m/s²", aliases: ["in/(h⋅s)", "inch per hour per second", "inches per hour per second"]

unit "mi/s²", value: "1609.344 m/s²", aliases: ["mi/s^2", "mi·s⁻²", "mps²", "mile per second squared", "miles per second squared"]
unit "mi/s²", value: "1609.344 m/s²", aliases: ["mi/s^2", "mps²", "mile per second squared", "miles per second squared"]
unit "mpm/s", value: "26.8224 m/s²", aliases: ["mi/(min⋅s)", "mile per minute per second", "miles per minute per second"]
unit "mph/s", value: "0.44704 m/s²", aliases: ["mi/(h⋅s)", "mile per hour per second", "miles per hour per second"]
end

system :foot_pound_second do
unit "ft/s²", value: "0.3048 m/s²", aliases: ["ft/s^2", "ft·s⁻²", "fps²", "foot per second squared", "feet per second squared"]
unit "ft/s²", value: "0.3048 m/s²", aliases: ["ft/s^2", "fps²", "foot per second squared", "feet per second squared"]
unit "fpm/s", value: "0.00508 m/s²", aliases: ["ft/(min⋅s)", "foot per minute per second", "feet per minute per second"]
unit "fph/s", value: "8.466667e-5 m/s²", aliases: ["ft/(h⋅s)", "foot per hour per second", "feet per hour per second"]
end
Expand Down
8 changes: 4 additions & 4 deletions lib/unit_measurements/unit_groups/angular_acceleration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
primitive "rad/s²"

system :metric do
si_unit "rad/s²", aliases: ["rad/s^2", "rad·s⁻²", "radian per second squared", "radians per second squared"]
unit "gon/s²", value: [(Math::PI / 200), "rad/s²"], aliases: ["gon/s^2", "ᵍ/s²", "gon·s⁻²", "gradian per second squared", "gradians per second squared"]
end
si_unit "rad/s²", aliases: ["rad/s^2", "radian per second squared", "radians per second squared"]

unit "deg/s²", value: [(Math::PI / 180), "rad/s²"], aliases: ["deg/s^2", "°/s²", "deg·s⁻²", "degree per second squared", "degrees per second squared"]
unit "deg/s²", value: [(Math::PI / 180), "rad/s²"], aliases: ["°/s²", "deg/s^2", "degree per second squared", "degrees per second squared"]
unit "gon/s²", value: [(Math::PI / 200), "rad/s²"], aliases: ["ᵍ/s²", "gon/s^2", "gradian per second squared", "gradians per second squared"]
end
end
26 changes: 13 additions & 13 deletions lib/unit_measurements/unit_groups/angular_velocity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
primitive "rad/s"

system :metric do
unit "rad/s", aliases: ["rad·s⁻¹", "radian per second", "radians per second"]
unit "rad/min", value: "1/60 rad/s", aliases: ["rad·min⁻¹", "radian per minute", "radians per minute"]
unit "rad/h", value: "1/60 rad/min", aliases: ["rad·h⁻¹", "radian per hour", "radians per hour"]
unit "rad/s", aliases: ["radian per second", "radians per second"]
unit "rad/min", value: "1/60 rad/s", aliases: ["radian per minute", "radians per minute"]
unit "rad/h", value: "1/60 rad/min", aliases: ["radian per hour", "radians per hour"]

unit "gon/s", value: [(Math::PI / 200), "rad/s"], aliases: ["ᵍ/s", "gon·s⁻¹", "gradian per second", "gradians per second"]
unit "gon/min", value: "1/60 gon/s", aliases: ["ᵍ/min", "gon·min⁻¹", "gradian per minute", "gradians per minute"]
unit "gon/h", value: "1/60 gon/min", aliases: ["ᵍ/h", "gon·h⁻¹", "gradian per hour", "gradians per hour"]
end
unit "deg/s", value: [(Math::PI / 180), "rad/s"], aliases: ["°/s", "degree per second", "degrees per second"]
unit "deg/min", value: "1/60 deg/s", aliases: ["°/min", "degree per minute", "degrees per minute"]
unit "deg/h", value: "1/60 deg/min", aliases: ["°/h", "degree per hour", "degrees per hour"]

unit "deg/s", value: [(Math::PI / 180), "rad/s"], aliases: ["°/s", "deg·s⁻¹", "degree per second", "degrees per second"]
unit "deg/min", value: "1/60 deg/s", aliases: ["°/min", "deg·min⁻¹", "degree per minute", "degrees per minute"]
unit "deg/h", value: "1/60 deg/min", aliases: ["°/h", "deg·h⁻¹", "degree per hour", "degrees per hour"]
unit "gon/s", value: [(Math::PI / 200), "rad/s"], aliases: ["ᵍ/s", "gradian per second", "gradians per second"]
unit "gon/min", value: "1/60 gon/s", aliases: ["ᵍ/min", "gradian per minute", "gradians per minute"]
unit "gon/h", value: "1/60 gon/min", aliases: ["ᵍ/h", "gradian per hour", "gradians per hour"]
end

unit "rev/s", value: "360 deg/s", aliases: ["rev·s⁻¹", "revolution per second", "revolutions per second"]
unit "rev/min", value: "1/60 rev/s", aliases: ["rev·min⁻¹", "revolution per minute", "revolutions per minute"]
unit "rev/h", value: "1/60 rev/min", aliases: ["rev·h⁻¹", "revolution per hour", "revolutions per hour"]
unit "rev/s", value: "360 deg/s", aliases: ["revolution per second", "revolutions per second"]
unit "rev/min", value: "1/60 rev/s", aliases: ["revolution per minute", "revolutions per minute"]
unit "rev/h", value: "1/60 rev/min", aliases: ["revolution per hour", "revolutions per hour"]
end
26 changes: 13 additions & 13 deletions lib/unit_measurements/unit_groups/density.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
primitive "kg/m³"

system :metric do
unit "g/m³", aliases: ["g/m^3", "g·m⁻³", "gram per cubic meter", "grams per cubic meter", "gramme per cubic metre", "grammes per cubic metre"]
unit "g/l", value: "1 kg/m³", aliases: ["g·l⁻¹", "gram per liter", "grams per liter", "gramme per litre", "grammes per litre"]
unit "g/ml", value: "1000 g/l", aliases: ["g·ml⁻¹", "gram per milliliter", "grams per milliliter", "gramme per millilitre", "grammes per millilitre"]
unit "g/m³", aliases: ["g/m^3", "gram per cubic meter", "grams per cubic meter", "gramme per cubic metre", "grammes per cubic metre"]
unit "g/l", value: "1 kg/m³", aliases: ["gram per liter", "grams per liter", "gramme per litre", "grammes per litre"]
unit "g/ml", value: "1000 g/l", aliases: ["gram per milliliter", "grams per milliliter", "gramme per millilitre", "grammes per millilitre"]

unit "kg/l", value: "1e+6 g/m³", aliases: ["kg·l⁻¹", "kilogram per liter", "kilograms per liter", "kilogramme per litre", "kilogrammes per litre"]
unit "kg/m³", value: "1000 g/m³", aliases: ["kg/m^3", "kg·m⁻³", "kilogram per cubic meter", "kilograms per cubic meter", "kilogramme per cubic metre", "kilogrammes per cubic metre"]
unit "kg/l", value: "1e+6 g/m³", aliases: ["kilogram per liter", "kilograms per liter", "kilogramme per litre", "kilogrammes per litre"]
unit "kg/m³", value: "1000 g/m³", aliases: ["kg/m^3", "kilogram per cubic meter", "kilograms per cubic meter", "kilogramme per cubic metre", "kilogrammes per cubic metre"]
end

system :imperial do
unit "oz/ft³", value: "1.001153961 kg/m³", aliases: ["oz/ft^3", "oz·ft⁻³", "ounce per cubic foot", "ounces per cubic foot"]
unit "oz/in³", value: "1.729994044e+3 kg/m³", aliases: ["oz/in^3", "oz·in⁻³", "ounce per cubic inch", "ounces per cubic inch"]
unit "oz/gal", value: "6.236023291 kg/m³", aliases: ["oz·gal⁻¹", "ounce per gallon", "ounces per gallon"]
unit "oz/ft³", value: "1.001153961 kg/m³", aliases: ["oz/ft^3", "ounce per cubic foot", "ounces per cubic foot"]
unit "oz/in³", value: "1.729994044e+3 kg/m³", aliases: ["oz/in^3", "ounce per cubic inch", "ounces per cubic inch"]
unit "oz/gal", value: "6.236023291 kg/m³", aliases: ["ounce per gallon", "ounces per gallon"]

unit "lb/ft³", value: "16.01846337 kg/m³", aliases: ["lb/ft^3", "lb·ft⁻³", "pound per cubic foot", "pounds per cubic foot"]
unit "lb/in³", value: "2.767990471e+4 kg/m³", aliases: ["lb/in^3", "lb·in⁻³", "pound per cubic inch", "pounds per cubic inch"]
unit "lb/gal", value: "99.77637266 kg/m³", aliases: ["lb·gal⁻¹", "pound per gallon", "pounds per gallon"]
unit "lb/ft³", value: "16.01846337 kg/m³", aliases: ["lb/ft^3", "pound per cubic foot", "pounds per cubic foot"]
unit "lb/in³", value: "2.767990471e+4 kg/m³", aliases: ["lb/in^3", "pound per cubic inch", "pounds per cubic inch"]
unit "lb/gal", value: "99.77637266 kg/m³", aliases: ["pound per gallon", "pounds per gallon"]

unit "slug/ft³", value: "515.3788184 kg/m³", aliases: ["slug/ft^3", "slug·ft⁻³", "slug per cubic foot", "slugs per cubic foot"]
unit "slug/in³", value: "890574.582782 kg/m³", aliases: ["slug/in^3", "slug·in⁻³", "slug per cubic inch", "slugs per cubic inch"]
unit "slug/ft³", value: "515.3788184 kg/m³", aliases: ["slug/ft^3", "slug per cubic foot", "slugs per cubic foot"]
unit "slug/in³", value: "890574.582782 kg/m³", aliases: ["slug/in^3", "slug per cubic inch", "slugs per cubic inch"]
end
end
4 changes: 2 additions & 2 deletions lib/unit_measurements/unit_groups/dynamic_viscosity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
end

system :foot_pound_second do
unit "lb/(ft⋅s)", value: "1.488164 Pa⋅s", aliases: ["lb/(ft*s)", "pound per foot second"]
unit "lb/(ft⋅h)", value: "0.0004133789 Pa⋅s", aliases: ["lb/(ft*h)", "pound per foot hour"]
unit "lb/(ft⋅s)", value: "1.488164 Pa⋅s", aliases: ["lb/(ft*s)", "pound per foot second", "pounds per foot second"]
unit "lb/(ft⋅h)", value: "0.0004133789 Pa⋅s", aliases: ["lb/(ft*h)", "pound per foot hour", "pounds per foot hour"]

unit "(lbf⋅s)/ft²", value: "47.88026 Pa⋅s", aliases: ["(lb⋅s)/ft²", "(lbf*s)/ft^2", "(lb*s)/ft^2", "pound-force second per square foot"]
unit "(lbf⋅s)/in²", value: "6894.757 Pa⋅s", aliases: ["(lb⋅s)/in²", "(lbf*s)/in^2", "(lb*s)/in^2", "pound-force second per square inch"]
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/electric_conductance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
system :metric do
si_unit "S", aliases: ["℧", "Ω⁻¹", "siemens", "mho", "mhos"]

unit "A/V", value: "1 S", aliases: ["A·V⁻¹", "amp/volt", "amps/volt", "ampere/volt", "amperes/volt", "ampere per volt", "amperes per volt"]
unit "A/V", value: "1 S", aliases: ["amp/volt", "amps/volt", "ampere/volt", "amperes/volt", "ampere per volt", "amperes per volt"]
end

system :centimetre_gram_second do
Expand Down
4 changes: 2 additions & 2 deletions lib/unit_measurements/unit_groups/electric_potential.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
system :metric do
si_unit "V", aliases: ["volt", "volts"]

unit "W/A", value: "1 V", aliases: ["W·A⁻¹", "watt per ampere", "watts per ampere"]
unit "J/C", value: "1 V", aliases: ["J·C⁻¹", "joule per coulomb", "joules per coulomb"]
unit "W/A", value: "1 V", aliases: ["watt per ampere", "watts per ampere"]
unit "J/C", value: "1 V", aliases: ["joule per coulomb", "joules per coulomb"]
end

system :centimetre_gram_second do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end

system :centimetre_gram_second do
unit "statC·cm²", value: "3.335641e-14 C·m²", aliases: ["statC*m^2", "statcoulomb square meter", "statcoulomb square metre"]
unit "B", value: "1e-26 statC·cm²", aliases: ["buckingham", "buckinghams"]
unit "statC·cm²", value: "3.335641e-14 C·m²", aliases: ["statC*m^2", "statcoulomb square meter", "statcoulomb square metre"]
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
system :metric do
si_unit "F", aliases: ["farad", "farads"]

unit "C/V", value: "1 F", aliases: ["C·V⁻¹", "coulomb/volt", "coulombs/volt", "coulomb per volt", "coulombs per volt"]
unit "C/V", value: "1 F", aliases: ["coulomb/volt", "coulombs/volt", "coulomb per volt", "coulombs per volt"]
end

system :centimetre_gram_second do
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/electrical_elastance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
system :metric do
si_unit "D", aliases: ["F⁻¹", "daraf", "darafs", "reciprocal farad", "reciprocal farads"]

unit "V/C", value: "1 D", aliases: ["V·C⁻¹", "volt/coulomb", "volts/coulomb", "volt per coulomb", "volts per coulomb"]
unit "V/C", value: "1 D", aliases: ["volt/coulomb", "volts/coulomb", "volt per coulomb", "volts per coulomb"]
end
end
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/electrical_inductance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
system :metric do
si_unit "H", aliases: ["henry", "henries"]

unit "Wb/A", value: "1 H", aliases: ["Wb·A⁻¹", "weber per ampere", "webers per ampere"]
unit "Wb/A", value: "1 H", aliases: ["weber per ampere", "webers per ampere"]
end

system :centimetre_gram_second do
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/electrical_resistance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
si_unit "Ω", aliases: ["ω", "ohm", "ohms", "reciprocal siemens"]

unit "S", value: "1 Ω", aliases: ["siemens", "mho", "mhos"]
unit "V/A", value: "1 Ω", aliases: ["V·A⁻¹", "volt/amp", "volts/amp", "volt/ampere", "volts/ampere", "volt per ampere", "volts per ampere"]
unit "V/A", value: "1 Ω", aliases: ["volt/amp", "volts/amp", "volt/ampere", "volts/ampere", "volt per ampere", "volts per ampere"]
end

system :centimetre_gram_second do
Expand Down
6 changes: 3 additions & 3 deletions lib/unit_measurements/unit_groups/frequency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
system :metric do
si_unit "Hz", aliases: ["hertz", "hertzes"]

unit "rad/s", value: [Rational(1, (2 * Math::PI)), "Hz"], aliases: ["rad·s⁻¹", "radian per second", "radians per second"]
unit "deg/s", value: [Rational(1, 360), "Hz"], aliases: ["°/s", "degree per second", "degrees per second"]
unit "rad/s", value: [Rational(1, (2 * Math::PI)), "Hz"], aliases: ["radian per second", "radians per second"]
end

unit "deg/s", value: [Rational(1, 360), "Hz"], aliases: ["°/s", "deg·s⁻¹", "degree per second", "degrees per second"]
unit "rev/s", value: [1, "Hz"], aliases: ["rps", "rev·s⁻¹", "revolution per second", "revolutions per second"]
unit "rev/s", value: [1, "Hz"], aliases: ["rps", "revolution per second", "revolutions per second"]
end
6 changes: 3 additions & 3 deletions lib/unit_measurements/unit_groups/illuminance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
primitive "lx"

system :metric do
si_unit "lx", aliases: ["lux", "lm/m²", "lm/m^2", "lm·m⁻²", "lumen per square metre", "lumen per square meter"]
si_unit "lx", aliases: ["lux", "lm/m²", "lm/m^2", "lumen per square metre", "lumen per square meter"]
end

system :centimetre_gram_second do
unit "ph", value: "10000 lx", aliases: ["phot", "phots", "lm/cm²", "lm/cm^2", "lm·cm⁻²", "lumen per square centimetre", "lumen per square centimeter"]
unit "ph", value: "10000 lx", aliases: ["phot", "phots", "lm/cm²", "lm/cm^2", "lumen per square centimetre", "lumen per square centimeter"]
end

system :us_customary do
unit "fc", value: "10.763910417 lx", aliases: ["footcandle", "lm/ft²", "lm/ft^2", "lm·ft⁻²", "lumen per square foot"]
unit "fc", value: "10.763910417 lx", aliases: ["footcandle", "lm/ft²", "lm/ft^2", "lumen per square foot"]
end

unit "nx", value: "1 mlx", aliases: ["nox"]
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/kinetic_viscosity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
end

system :centimetre_gram_second do
unit "St", value: "1e-4 m²/s", aliases: ["strokes"]
unit "St", value: "1e-4 m²/s", aliases: ["stoke", "strokes"]
end
end
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/length.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
unit "in", value: "25.4 mm", aliases: ['"', "inch", "inches"]
unit "ft", value: "12 in", aliases: ["'", "foot", "feet"]
unit "yd", value: "3 ft", aliases: ["yard", "yards"]
unit "mi", value: "5280 ft", aliases: ["mile", "miles", "statute mile", "international mile"]
unit "mi", value: "5280 ft", aliases: ["mile", "miles", "statute mile", "international mile", "statute miles", "international miles"]
unit "ch", value: "22 yd", aliases: ["chain", "chains"]
unit "th", value: "1/1000 in", aliases: ["thou", "thousandth of an inch", "mil", "mils"]
unit "nl", value: "3 nmi", aliases: ["NL", "nleague", "nleagues", "nautical league", "nautical leagues"]
Expand Down
7 changes: 4 additions & 3 deletions lib/unit_measurements/unit_groups/luminance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
primitive "cd/m²"

system :metric do
unit "cd/m²", aliases: ["cd/m^2", "cd·m⁻²", "candela per square metre", "candelas per square metre", "candela per square meter", "candelas per square meter"]
unit "cd/m²", aliases: ["cd/m^2", "candela per square metre", "candelas per square metre", "candela per square meter", "candelas per square meter"]
end

system :us_customary do
unit "cd/in²", value: "1550.0031 cd/m²", aliases: ["cd/in^2", "cd·in⁻²", "candela per square inch", "candelas per square inch"]
unit "cd/ft²", value: "10.763910417 cd/m²", aliases: ["cd/ft^2", "cd·ft⁻²", "candela per square foot", "candelas per square foot"]
unit "fL", value: [Rational(1, Math::PI), "cd/ft²"], aliases: ["ft-L", "foot lambert", "foot-lambert"]

unit "cd/in²", value: "1550.0031 cd/m²", aliases: ["cd/in^2", "candela per square inch", "candelas per square inch"]
unit "cd/ft²", value: "10.763910417 cd/m²", aliases: ["cd/ft^2", "candela per square foot", "candelas per square foot"]
end

system :centimetre_gram_second do
Expand Down
2 changes: 1 addition & 1 deletion lib/unit_measurements/unit_groups/magnetic_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
system :metric do
si_unit "Oe", aliases: ["oersted", "oersteds"]

unit "A/m", value: [(Math::PI / 250), "Oe"], aliases: ["A·m⁻¹", "ampere/meter", "ampere/metre", "amperes/meter", "amperes/metre", "ampere per meter", "ampere per metre", "amperes per meter", "amperes per metre"]
unit "A/m", value: [(Math::PI / 250), "Oe"], aliases: ["ampere/meter", "ampere/metre", "amperes/meter", "amperes/metre", "ampere per meter", "ampere per metre", "amperes per meter", "amperes per metre"]
end
end
4 changes: 2 additions & 2 deletions lib/unit_measurements/unit_groups/power.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
end

system :centimetre_gram_second do
unit "erg/s", value: "1e-7 W", aliases: ["erg·s⁻¹", "erg per second", "ergs per second"]
unit "erg/s", value: "1e-7 W", aliases: ["erg per second", "ergs per second"]
end

unit "cal/s", value: "4.1868 W", aliases: ["cal·s⁻¹", "calorie per second", "calories per second"]
unit "cal/s", value: "4.1868 W", aliases: ["calorie per second", "calories per second"]
end
3 changes: 2 additions & 1 deletion lib/unit_measurements/unit_groups/radiation_absorbed_dose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
end

system :centimetre_gram_second do
unit "erg/g", value: "1e-4 Gy", aliases: ["erg per gram", "erg per gramme", "ergs per gram", "ergs per gramme"]
unit "rad", value: "0.01 Gy", aliases: ["radiation absorbed dose"]

unit "erg/g", value: "1e-4 Gy", aliases: ["erg per gram", "erg per gramme", "ergs per gram", "ergs per gramme"]
end
end
4 changes: 3 additions & 1 deletion lib/unit_measurements/unit_groups/solid_angle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

system :metric do
si_unit "sr", aliases: ["steradian", "steradians"]

unit "deg²", value: [((Math::PI / 180) ** 2), "sr"], aliases: ["(°)²", "sq °", "square degree", "square degrees"] # (π / 180)² sr
end

unit "sp", value: [(4 * Math::PI), "sr"], aliases: ["spat", "spats"] # (4 * π) sr
unit "deg²", value: [((Math::PI / 180) ** 2), "sr"], aliases: ["(°)²", "sq °", "square degree", "square degrees"] # (π / 180)² sr

unit "arcmin²", value: [(Rational(1, 60) ** 2), "deg²"], aliases: ["(′)²", "sq ′", "square arcminute", "square arcminutes"] # ((π / 180) * (1 / 60))² sr
unit "arcsec²", value: [(Rational(1, 60) ** 2), "arcmin²"], aliases: ["(″)²", "sq ″", "square arcsecond", "square arcseconds"] # ((π / 180) * (1 / 3600))² sr
end
2 changes: 2 additions & 0 deletions lib/unit_measurements/unit_groups/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
unit "wk", value: "7 d", aliases: ["week", "weeks"]
unit "mo", value: "30.4167 d", aliases: ["month", "months"]
unit "yr", value: "365 d", aliases: ["y", "year", "years"]

unit "ftn", value: "2 wk", aliases: ["4tnite", "fortnight", "fortnights"]
unit "qtr", value: "3 mo", aliases: ["quarter", "quarters"]
unit "dec", value: "10 y", aliases: ["decade", "decades"]

unit "cent", value: "10 dec", aliases: ["century", "centuries"]
end
Loading

0 comments on commit d9581cb

Please sign in to comment.