Sha256: 75a527254fdaec108d3a2652fc10e7b86fcb573e47633c9b9e9f053b99db9d29

Contents?: true

Size: 1.12 KB

Versions: 19

Compression:

Stored size: 1.12 KB

Contents

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

UnitMeasurements::PlaneAngle = UnitMeasurements.build do
  primitive "rad"

  system :metric do
    si_unit "rad", aliases: ["radian", "radians"]

    unit "gon", value: [(Math::PI / 200), "rad"], aliases: ["ᵍ", "grad", "gradian", "gradians"] # (π / 200) rad
  end

  unit "deg", value: [(Math::PI / 180), "rad"], aliases: ["°", "degree", "degrees"] # (π / 180) rad
  unit "cir", value: [360, "deg"], aliases: ["circle", "circles"] # (2 * π) rad
  unit "mil", value: [Rational(1, 6400), "cir"], aliases: ["mils"] # ((2 * π) / 6400) rad
  unit "rev", value: [1, "cir"], aliases: ["revolution", "revolutions"] # (2 * π) rad

  unit "brad", value: [(Math::PI / 128), "rad"], aliases: ["b°", "bdeg", "binary degree", "binary radian", "binary degrees", "binary radians"] # (π / 128) rad

  unit "arcmin", value: [Rational(1, 60), "deg"], aliases: ["′", "amin", "arcminute", "arcminutes"] # ((π / 180) / 60) rad
  unit "arcsec", value: [Rational(1, 60), "arcmin"], aliases: ["″", "asec", "arcsecond", "arcseconds"] # ((π / 180) / 3600) rad
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
unit_measurements-5.4.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-5.3.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-5.2.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-5.1.1 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-5.1.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-5.0.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.12.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.11.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.10.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.9.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.8.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.7.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.6.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.5.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.4.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.3.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.2.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.1.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-4.0.0 lib/unit_measurements/unit_groups/plane_angle.rb