sixarm_ruby_geometry 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +18 -0
- data/lib/sixarm_ruby_geometry.rb +41 -0
- data/lib/sixarm_ruby_geometry/indexable.rb +7 -0
- data/lib/sixarm_ruby_geometry/indexable/d1.rb +12 -0
- data/lib/sixarm_ruby_geometry/indexable/d2.rb +12 -0
- data/lib/sixarm_ruby_geometry/indexable/d3.rb +12 -0
- data/lib/sixarm_ruby_geometry/indexable/pitch.rb +15 -0
- data/lib/sixarm_ruby_geometry/indexable/rad.rb +15 -0
- data/lib/sixarm_ruby_geometry/indexable/width.rb +20 -0
- data/lib/sixarm_ruby_geometry/indexable/width_height.rb +30 -0
- data/lib/sixarm_ruby_geometry/indexable/width_height_depth.rb +40 -0
- data/lib/sixarm_ruby_geometry/indexable/x.rb +18 -0
- data/lib/sixarm_ruby_geometry/indexable/xy.rb +26 -0
- data/lib/sixarm_ruby_geometry/indexable/xyz.rb +40 -0
- data/lib/sixarm_ruby_geometry/indexable/yaw.rb +15 -0
- data/lib/sixarm_ruby_geometry/point.rb +7 -0
- data/lib/sixarm_ruby_geometry/point/array.rb +12 -0
- data/lib/sixarm_ruby_geometry/point/array/d1.rb +14 -0
- data/lib/sixarm_ruby_geometry/point/array/d2.rb +14 -0
- data/lib/sixarm_ruby_geometry/point/array/d3.rb +14 -0
- data/lib/sixarm_ruby_geometry/point/vector.rb +12 -0
- data/lib/sixarm_ruby_geometry/point/vector/d1.rb +14 -0
- data/lib/sixarm_ruby_geometry/point/vector/d2.rb +14 -0
- data/lib/sixarm_ruby_geometry/point/vector/d3.rb +14 -0
- data/lib/sixarm_ruby_geometry/space.rb +7 -0
- data/lib/sixarm_ruby_geometry/space/array.rb +12 -0
- data/lib/sixarm_ruby_geometry/space/array/d1.rb +14 -0
- data/lib/sixarm_ruby_geometry/space/array/d2.rb +14 -0
- data/lib/sixarm_ruby_geometry/space/array/d3.rb +14 -0
- data/lib/sixarm_ruby_geometry/space/vector.rb +12 -0
- data/lib/sixarm_ruby_geometry/space/vector/d1.rb +14 -0
- data/lib/sixarm_ruby_geometry/space/vector/d2.rb +14 -0
- data/lib/sixarm_ruby_geometry/space/vector/d3.rb +14 -0
- data/test/sixarm_ruby_geometry_test.rb +1 -0
- data/test/sixarm_ruby_geometry_test/indexable/d1_test.rb +34 -0
- data/test/sixarm_ruby_geometry_test/indexable/d2_test.rb +36 -0
- data/test/sixarm_ruby_geometry_test/indexable/d3_test.rb +38 -0
- data/test/sixarm_ruby_geometry_test/indexable/pitch_test.rb +36 -0
- data/test/sixarm_ruby_geometry_test/indexable/rad_test.rb +31 -0
- data/test/sixarm_ruby_geometry_test/indexable/width_height_depth_test.rb +70 -0
- data/test/sixarm_ruby_geometry_test/indexable/width_height_test.rb +56 -0
- data/test/sixarm_ruby_geometry_test/indexable/width_test.rb +42 -0
- data/test/sixarm_ruby_geometry_test/indexable/x_test.rb +42 -0
- data/test/sixarm_ruby_geometry_test/indexable/xy_test.rb +56 -0
- data/test/sixarm_ruby_geometry_test/indexable/xyz_test.rb +72 -0
- data/test/sixarm_ruby_geometry_test/indexable/yaw_test.rb +31 -0
- data/test/sixarm_ruby_geometry_test/indexable_test.rb +31 -0
- data/test/sixarm_ruby_geometry_test/point/array/d1_test.rb +35 -0
- data/test/sixarm_ruby_geometry_test/point/array/d2_test.rb +37 -0
- data/test/sixarm_ruby_geometry_test/point/array/d3_test.rb +39 -0
- data/test/sixarm_ruby_geometry_test/point/array_test.rb +33 -0
- data/test/sixarm_ruby_geometry_test/point/vector/d1_test.rb +36 -0
- data/test/sixarm_ruby_geometry_test/point/vector/d2_test.rb +38 -0
- data/test/sixarm_ruby_geometry_test/point/vector/d3_test.rb +40 -0
- data/test/sixarm_ruby_geometry_test/point/vector_test.rb +34 -0
- data/test/sixarm_ruby_geometry_test/point_test.rb +25 -0
- data/test/sixarm_ruby_geometry_test/space/array/d1_test.rb +35 -0
- data/test/sixarm_ruby_geometry_test/space/array/d2_test.rb +37 -0
- data/test/sixarm_ruby_geometry_test/space/array/d3_test.rb +39 -0
- data/test/sixarm_ruby_geometry_test/space/array_test.rb +33 -0
- data/test/sixarm_ruby_geometry_test/space/vector/d1_test.rb +36 -0
- data/test/sixarm_ruby_geometry_test/space/vector/d2_test.rb +38 -0
- data/test/sixarm_ruby_geometry_test/space/vector/d3_test.rb +40 -0
- data/test/sixarm_ruby_geometry_test/space/vector_test.rb +34 -0
- data/test/sixarm_ruby_geometry_test/space_test.rb +25 -0
- metadata +262 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/point/vector/d2"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Point
|
10
|
+
module Vector
|
11
|
+
module D2
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Point::Vector::D2)
|
16
|
+
end
|
17
|
+
|
18
|
+
require "matrix"
|
19
|
+
class C < ::Vector
|
20
|
+
include ::Point::Vector::D2
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_new
|
24
|
+
assert(C[0, 0])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_index
|
28
|
+
e0 = fake_n
|
29
|
+
e1 = fake_n
|
30
|
+
c = C[e0, e1]
|
31
|
+
assert_equal(e0, c[0])
|
32
|
+
assert_equal(e1, c[1])
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/point/vector/d3"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Point
|
10
|
+
module Vector
|
11
|
+
module D3
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Point::Vector::D3)
|
16
|
+
end
|
17
|
+
|
18
|
+
require "matrix"
|
19
|
+
class C < ::Vector
|
20
|
+
include ::Point::Vector::D3
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_new
|
24
|
+
assert(C[0,0,0])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_index
|
28
|
+
e0 = fake_n
|
29
|
+
e1 = fake_n
|
30
|
+
e2 = fake_n
|
31
|
+
c = C[e0, e1, e2]
|
32
|
+
assert_equal(e0, c[0])
|
33
|
+
assert_equal(e1, c[1])
|
34
|
+
assert_equal(e2, c[2])
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/point/vector"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Point
|
10
|
+
module Vector
|
11
|
+
class Test < Minitest::Test
|
12
|
+
|
13
|
+
def test_0
|
14
|
+
assert(::Point::Vector)
|
15
|
+
end
|
16
|
+
|
17
|
+
require "matrix"
|
18
|
+
class C < ::Vector
|
19
|
+
include ::Point::Vector
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new
|
23
|
+
assert(C[0])
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_index
|
27
|
+
e0 = fake_n
|
28
|
+
c = C[e0]
|
29
|
+
assert_equal(e0, c[0])
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/point"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Point
|
10
|
+
class Test < Minitest::Test
|
11
|
+
|
12
|
+
def test_0
|
13
|
+
assert(::Point)
|
14
|
+
end
|
15
|
+
|
16
|
+
class C
|
17
|
+
include ::Point
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_include
|
21
|
+
assert_includes(C.ancestors, ::Point)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/array/d1"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Array
|
11
|
+
module D1
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Array::D1)
|
16
|
+
end
|
17
|
+
|
18
|
+
class C < ::Array
|
19
|
+
include ::Space::Array::D1
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new
|
23
|
+
assert(C[0])
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_index
|
27
|
+
e0 = fake_n
|
28
|
+
c = C[e0]
|
29
|
+
assert_equal(e0, c[0])
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/array/d2"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Array
|
11
|
+
module D2
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Array::D2)
|
16
|
+
end
|
17
|
+
|
18
|
+
class C < ::Array
|
19
|
+
include ::Space::Array::D2
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new
|
23
|
+
assert(C[0, 0])
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_index
|
27
|
+
e0 = fake_n
|
28
|
+
e1 = fake_n
|
29
|
+
c = C[e0, e1]
|
30
|
+
assert_equal(e0, c[0])
|
31
|
+
assert_equal(e1, c[1])
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/array/d3"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Array
|
11
|
+
module D3
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Array::D3)
|
16
|
+
end
|
17
|
+
|
18
|
+
class C < ::Array
|
19
|
+
include ::Space::Array::D3
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new
|
23
|
+
assert(C[0, 0, 0])
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_index
|
27
|
+
e0 = fake_n
|
28
|
+
e1 = fake_n
|
29
|
+
e2 = fake_n
|
30
|
+
c = C[e0, e1, e2]
|
31
|
+
assert_equal(e0, c[0])
|
32
|
+
assert_equal(e1, c[1])
|
33
|
+
assert_equal(e2, c[2])
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/array"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Array
|
11
|
+
class Test < Minitest::Test
|
12
|
+
|
13
|
+
def test_0
|
14
|
+
assert(::Space::Array)
|
15
|
+
end
|
16
|
+
|
17
|
+
class C < ::Array
|
18
|
+
include ::Space::Array
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_new
|
22
|
+
assert(C[0])
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_index
|
26
|
+
e0 = fake_n
|
27
|
+
c = C[e0]
|
28
|
+
assert_equal(e0, c[0])
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/vector/d1"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Vector
|
11
|
+
module D1
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Vector::D1)
|
16
|
+
end
|
17
|
+
|
18
|
+
require "matrix"
|
19
|
+
class C < ::Vector
|
20
|
+
include ::Space::Vector::D1
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_new
|
24
|
+
assert(C[0,0])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_index
|
28
|
+
e0 = fake_n
|
29
|
+
c = C[e0]
|
30
|
+
assert_equal(e0, c[0])
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/vector/d2"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Vector
|
11
|
+
module D2
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Vector::D2)
|
16
|
+
end
|
17
|
+
|
18
|
+
require "matrix"
|
19
|
+
class C < ::Vector
|
20
|
+
include ::Space::Vector::D2
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_new
|
24
|
+
assert(C[0, 0])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_index
|
28
|
+
e0 = fake_n
|
29
|
+
e1 = fake_n
|
30
|
+
c = C[e0, e1]
|
31
|
+
assert_equal(e0, c[0])
|
32
|
+
assert_equal(e1, c[1])
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/vector/d3"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Vector
|
11
|
+
module D3
|
12
|
+
class Test < Minitest::Test
|
13
|
+
|
14
|
+
def test_0
|
15
|
+
assert(::Space::Vector::D3)
|
16
|
+
end
|
17
|
+
|
18
|
+
require "matrix"
|
19
|
+
class C < ::Vector
|
20
|
+
include ::Space::Vector::D3
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_new
|
24
|
+
assert(C[0,0,0])
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_index
|
28
|
+
e0 = fake_n
|
29
|
+
e1 = fake_n
|
30
|
+
e2 = fake_n
|
31
|
+
c = C[e0, e1 , e2]
|
32
|
+
assert_equal(c[0], e0)
|
33
|
+
assert_equal(c[1], e1)
|
34
|
+
assert_equal(c[2], e2)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "minitest/autorun"
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "sixarm_ruby_geometry/space/vector"
|
7
|
+
require "sixarm_ruby_geometry_test/fake"
|
8
|
+
|
9
|
+
module Space
|
10
|
+
module Vector
|
11
|
+
class Test < Minitest::Test
|
12
|
+
|
13
|
+
def test_0
|
14
|
+
assert(::Space::Vector)
|
15
|
+
end
|
16
|
+
|
17
|
+
require "matrix"
|
18
|
+
class C < ::Vector
|
19
|
+
include ::Space::Vector
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new
|
23
|
+
assert(C[0,0])
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_index
|
27
|
+
e0 = fake_n
|
28
|
+
c = C[e0]
|
29
|
+
assert_equal(e0, c[0])
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|