Sha256: f73d7adc3f604d5d95048b3c51718ce24533d579f33c7a812969c1a9cf7baeb3

Contents?: true

Size: 814 Bytes

Versions: 14

Compression:

Stored size: 814 Bytes

Contents

# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

UnitMeasurements::SolidAngle = UnitMeasurements.build do
  primitive "sr"

  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 "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

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
unit_measurements_us_complete-5.17.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.17.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.16.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.15.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.14.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.13.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.12.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.11.1 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.11.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.10.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.9.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.8.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.7.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-5.6.1 lib/unit_measurements/unit_groups/solid_angle.rb