vector2d 0.5.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +37 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/vector2d.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,9 +1,45 @@
|
|
1
|
-
|
1
|
+
= Vector2d
|
2
2
|
|
3
3
|
Vector2d allows for easy handling of two-dimensionals coordinates and vectors.
|
4
4
|
It's very flexible, most methods accepts arguments as strings, arrays, hashes
|
5
5
|
or Vector2d objects.
|
6
6
|
|
7
|
+
== Installation
|
8
|
+
|
9
|
+
Install from RubyForge:
|
10
|
+
|
11
|
+
sudo gem install vector2d
|
12
|
+
|
13
|
+
Install from GitHub:
|
14
|
+
|
15
|
+
gem sources -a http://gems.github.com
|
16
|
+
sudo gem install elektronaut-vector2d
|
17
|
+
|
18
|
+
== Usage examples
|
19
|
+
|
20
|
+
require 'vector2d'
|
21
|
+
|
22
|
+
# These are equal
|
23
|
+
v = Vector2d.new(50, 70)
|
24
|
+
v = Vector2d.new('50x70')
|
25
|
+
|
26
|
+
v.aspect_ratio # => 0.714285714285714
|
27
|
+
v.length # => 86.0232526704263
|
28
|
+
|
29
|
+
# Calculations work as expected
|
30
|
+
v * 2 # => #<Vector2d:0x5d994 @y=140.0, @x=100.0>
|
31
|
+
v + Vector2d.new(20,30) # => #<Vector2d:0x59c54 @y=100.0, @x=70.0>
|
32
|
+
|
33
|
+
v.constrain_both(64, 64) # => #<Vector2d:0x47e28 @y=64.0, @x=45.7142857142857>
|
34
|
+
|
35
|
+
== API Documentation
|
36
|
+
|
37
|
+
Is available at http://vector2d.rubyforge.org/
|
38
|
+
|
39
|
+
== Source code
|
40
|
+
|
41
|
+
Is available at http://github.com/elektronaut/vector2d
|
42
|
+
|
7
43
|
== Licence
|
8
44
|
|
9
45
|
(The MIT License)
|
data/Rakefile
CHANGED
@@ -52,7 +52,7 @@ begin
|
|
52
52
|
)
|
53
53
|
|
54
54
|
host = "#{config['username']}@rubyforge.org"
|
55
|
-
remote_dir = "/var/www/gforge-projects/
|
55
|
+
remote_dir = "/var/www/gforge-projects/vector2d/"
|
56
56
|
local_dir = 'rdoc'
|
57
57
|
|
58
58
|
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
data/vector2d.gemspec
CHANGED