vector2d 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Gemfile.lock +1 -1
- data/LICENSE +1 -1
- data/README.md +29 -0
- data/lib/vector2d.rb +74 -220
- data/lib/vector2d/calculations.rb +141 -0
- data/lib/vector2d/coercions.rb +64 -0
- data/lib/vector2d/fitting.rb +39 -0
- data/lib/vector2d/properties.rb +46 -0
- data/lib/vector2d/transformations.rb +57 -0
- data/lib/vector2d/version.rb +1 -1
- data/spec/lib/vector2d/calculations_spec.rb +126 -0
- data/spec/lib/vector2d/coercions_spec.rb +55 -0
- data/spec/lib/vector2d/fitting_spec.rb +48 -0
- data/spec/lib/vector2d/properties_spec.rb +43 -0
- data/spec/lib/vector2d/transformations_spec.rb +57 -0
- data/spec/lib/vector2d_spec.rb +31 -268
- data/spec/spec_helper.rb +2 -0
- data/vector2d.gemspec +2 -0
- metadata +20 -5
- data/README.rdoc +0 -61
- data/VERSION +0 -1
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vector2d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -47,14 +47,24 @@ extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
49
|
- ".gitignore"
|
50
|
+
- ".travis.yml"
|
50
51
|
- Gemfile
|
51
52
|
- Gemfile.lock
|
52
53
|
- LICENSE
|
53
|
-
- README.
|
54
|
+
- README.md
|
54
55
|
- Rakefile
|
55
|
-
- VERSION
|
56
56
|
- lib/vector2d.rb
|
57
|
+
- lib/vector2d/calculations.rb
|
58
|
+
- lib/vector2d/coercions.rb
|
59
|
+
- lib/vector2d/fitting.rb
|
60
|
+
- lib/vector2d/properties.rb
|
61
|
+
- lib/vector2d/transformations.rb
|
57
62
|
- lib/vector2d/version.rb
|
63
|
+
- spec/lib/vector2d/calculations_spec.rb
|
64
|
+
- spec/lib/vector2d/coercions_spec.rb
|
65
|
+
- spec/lib/vector2d/fitting_spec.rb
|
66
|
+
- spec/lib/vector2d/properties_spec.rb
|
67
|
+
- spec/lib/vector2d/transformations_spec.rb
|
58
68
|
- spec/lib/vector2d_spec.rb
|
59
69
|
- spec/spec_helper.rb
|
60
70
|
- vector2d.gemspec
|
@@ -70,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
80
|
requirements:
|
71
81
|
- - ">="
|
72
82
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
83
|
+
version: 1.9.2
|
74
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
85
|
requirements:
|
76
86
|
- - ">="
|
@@ -83,5 +93,10 @@ signing_key:
|
|
83
93
|
specification_version: 4
|
84
94
|
summary: Library for handling two-dimensional vectors
|
85
95
|
test_files:
|
96
|
+
- spec/lib/vector2d/calculations_spec.rb
|
97
|
+
- spec/lib/vector2d/coercions_spec.rb
|
98
|
+
- spec/lib/vector2d/fitting_spec.rb
|
99
|
+
- spec/lib/vector2d/properties_spec.rb
|
100
|
+
- spec/lib/vector2d/transformations_spec.rb
|
86
101
|
- spec/lib/vector2d_spec.rb
|
87
102
|
- spec/spec_helper.rb
|
data/README.rdoc
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
= Vector2d
|
2
|
-
|
3
|
-
Vector2d allows for easy handling of two-dimensionals coordinates and vectors.
|
4
|
-
It's very flexible, most methods accepts arguments as strings, arrays, hashes
|
5
|
-
or Vector2d objects.
|
6
|
-
|
7
|
-
== Installation
|
8
|
-
|
9
|
-
gem install vector2d
|
10
|
-
|
11
|
-
== Usage examples
|
12
|
-
|
13
|
-
require 'vector2d'
|
14
|
-
|
15
|
-
# These are equal
|
16
|
-
v = Vector2d.new(50, 70)
|
17
|
-
v = Vector2d.new('50x70')
|
18
|
-
|
19
|
-
v.aspect_ratio # => 0.714285714285714
|
20
|
-
v.length # => 86.0232526704263
|
21
|
-
|
22
|
-
# Calculations work as expected
|
23
|
-
v * 2 # => #<Vector2d:0x5d994 @y=140.0, @x=100.0>
|
24
|
-
v + Vector2d.new(20,30) # => #<Vector2d:0x59c54 @y=100.0, @x=70.0>
|
25
|
-
|
26
|
-
v.constrain_both(64, 64) # => #<Vector2d:0x47e28 @y=64.0, @x=45.7142857142857>
|
27
|
-
|
28
|
-
== API Documentation
|
29
|
-
|
30
|
-
Is available at http://vector2d.rubyforge.org
|
31
|
-
|
32
|
-
== Source code
|
33
|
-
|
34
|
-
Is available at http://github.com/elektronaut/vector2d
|
35
|
-
|
36
|
-
== Licence
|
37
|
-
|
38
|
-
(The MIT License)
|
39
|
-
|
40
|
-
Copyright (c) 2006 Inge Jørgensen
|
41
|
-
|
42
|
-
Permission is hereby granted, free of charge, to any person
|
43
|
-
obtaining a copy of this software and associated documentation
|
44
|
-
files (the "Software"), to deal in the Software without
|
45
|
-
restriction, including without limitation the rights to use,
|
46
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
47
|
-
copies of the Software, and to permit persons to whom the
|
48
|
-
Software is furnished to do so, subject to the following
|
49
|
-
conditions:
|
50
|
-
|
51
|
-
The above copyright notice and this permission notice shall be
|
52
|
-
included in all copies or substantial portions of the Software.
|
53
|
-
|
54
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
55
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
56
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
57
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
58
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
59
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
60
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
61
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.1
|