Sha256: 765d6063170df01e50accb126a7a43f730efa98eb7f5ebb0ba61961d932bfa0f

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

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

module Indexable
  class PitchTest < Minitest::Test

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

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

    DELTA = 0.00001

    def test_pitch_with_xy_any_and_z_zero
      assert_in_delta(Math::PI *  0.0, C[fake_n, fake_n,  0].pitch, DELTA)
    end

    def test_pitch_with_xy_zero_and_z_positive
      assert_in_delta(Math::PI *  0.5, C[ 0, 0,  fake_n].pitch, DELTA)
    end

    def test_pitch_with_xy_zero_and_z_negative
      assert_in_delta(Math::PI * -0.5, C[ 0, 0, -fake_n].pitch, 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/pitch_test.rb