Sha256: 18367a2936f783cd95f8c4a8348e7267997d2265955c1e5488a78fc1a353f7a2

Contents?: true

Size: 1017 Bytes

Versions: 2

Compression:

Stored size: 1017 Bytes

Contents

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

UnitMeasurements::PlaneAngle = UnitMeasurements.build do
  si_unit :rad, aliases: [:radian, :radians]

  unit :deg, value: [(Math::PI / 180), :rad], aliases: [:°, :degree, :degrees] # (π / 180) rad
  unit :gon, value: [(Math::PI / 200), :rad], aliases: [:ᵍ, :grad, :gradian, :gradians] # (π / 200) rad
  unit :cir, value: "360 deg", aliases: [:circle, :circles] # (2 * π) rad
  unit :mil, value: "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: "1/60 deg", aliases: [:′, :amin, :arcminute, :arcminutes] # ((π / 180) / 60) rad
  unit :arcsec, value: "1/60 arcmin", aliases: [:″, :asec, :arcsecond, :arcseconds] # ((π / 180) / 3600) rad
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unit_measurements-2.6.0 lib/unit_measurements/unit_groups/plane_angle.rb
unit_measurements-2.5.0 lib/unit_measurements/unit_groups/plane_angle.rb