Sha256: 9fac8fd720d4d3427f777d8a5f3f731b8fe158816bf2c415df47706bc4e20b70

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

# -*- coding: utf-8 -*-
require "sixarm_ruby_geometry_test"
require "sixarm_ruby_geometry/indexable/rad"
require "sixarm_ruby_geometry_test/fake"

module Indexable
  class RadTest < Minitest::Test

    def test_0
      assert(::Indexable::Rad)
    end

    require "matrix"
    class C < Vector
      include ::Indexable::Rad
    end

    DELTA = 0.00001

    def test_rad
      assert_in_delta(Math::PI *  0.0, C[ 1, 0].rad, DELTA)
      assert_in_delta(Math::PI *  0.5, C[ 0, 1].rad, DELTA)
      assert_in_delta(Math::PI *  1.0, C[-1, 0].rad, DELTA)
      assert_in_delta(Math::PI * -0.5, C[ 0,-1].rad, DELTA)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sixarm_ruby_geometry-4.0.0 test/sixarm_ruby_geometry_test/indexable/rad_test.rb