Sha256: fcf01c7ee4e7d9c8f860506f02a264c95d6aad9409a5e4d80c3590b2d4782d16

Contents?: true

Size: 782 Bytes

Versions: 2

Compression:

Stored size: 782 Bytes

Contents

# -*- coding: utf-8 -*-
require "minitest/autorun"
require "simplecov"
SimpleCov.start

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

2 entries across 2 versions & 1 rubygems

Version Path
sixarm_ruby_geometry-3.1.1 test/sixarm_ruby_geometry_test/indexable/pitch_test.rb
sixarm_ruby_geometry-3.0.0 test/sixarm_ruby_geometry_test/indexable/pitch_test.rb