Sha256: 9f235613d62de220122a54ba3e7c8be0357f4f5a52675822b0c7720d953ee381

Contents?: true

Size: 810 Bytes

Versions: 7

Compression:

Stored size: 810 Bytes

Contents

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

UnitMeasurements::SolidAngle = UnitMeasurements.build do
  system :metric do
    primitive :sr

    si_unit :sr, aliases: [:steradian, :steradians]
  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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
unit_measurements-3.8.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.7.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.6.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.5.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.4.1 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.3.0 lib/unit_measurements/unit_groups/solid_angle.rb
unit_measurements-3.4.0 lib/unit_measurements/unit_groups/solid_angle.rb