rubyllipse 1.0.2 → 1.0.3
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/README.md +1 -0
- data/lib/rubyllipse.rb +32 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e95846ae555896cde084e74ac76b7abbba01651404a77e85efab3d3e2c7ea606
|
4
|
+
data.tar.gz: 48d4ba2e148837cfcf605e340eab8dabefd4b223b04520ec6c266b82bdca938f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d7320676f32565830088472313aa56e01f089a7c11edaef68eab2407bd2b1be3fe95a326da87f7932198f6e97edd6fb5eb79f7b0df72a5ab2efa03d7727817a
|
7
|
+
data.tar.gz: 90fa997fd0df78a6db7775916f39c87180a2ac76700ee0927f66c0f470a01685cc58fdeefe4bac6bf404779e3e0db15f5a96e2663c3946b40a24014a666afdbe
|
data/README.md
CHANGED
@@ -19,3 +19,4 @@ Other methods are for accessing the object's attributes and don't need further e
|
|
19
19
|
|
20
20
|
## Notes
|
21
21
|
If you used the module and found something odd, bad, please send me an e-mail; I am still new to Ruby.
|
22
|
+
This version is the most stable version that doesn't have rotation.
|
data/lib/rubyllipse.rb
CHANGED
@@ -30,7 +30,7 @@ module Rubyllipse
|
|
30
30
|
elsif @form == 'vertical'
|
31
31
|
@focii = [[@center[0], @center[1]+@focal_length], [@center[0], @center[1]-@focal_length]]
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
@eccentricity = Float(@focal_length)/@major_radius
|
35
35
|
end
|
36
36
|
|
@@ -69,6 +69,14 @@ module Rubyllipse
|
|
69
69
|
def eccentricity
|
70
70
|
return @eccentricity
|
71
71
|
end
|
72
|
+
|
73
|
+
def center
|
74
|
+
return @center
|
75
|
+
end
|
76
|
+
|
77
|
+
def form
|
78
|
+
return @form
|
79
|
+
end
|
72
80
|
|
73
81
|
def give_function!
|
74
82
|
c_x = @center[0]
|
@@ -80,20 +88,40 @@ module Rubyllipse
|
|
80
88
|
a = @major_radius**2
|
81
89
|
b = @minor_radius**2
|
82
90
|
end
|
83
|
-
equation = "(x-#{c_x})^2/#{
|
91
|
+
equation = "(x-#{c_x})^2/#{b} + (y-#{c_y})^2/#{a} = 1"
|
84
92
|
return equation
|
85
93
|
end
|
86
94
|
|
87
95
|
def move_horizontally(distance)
|
88
96
|
@center = [@center[0]+distance, @center[1]]
|
89
|
-
self.initialize(@major_radius, @minor_radius, @center)
|
97
|
+
self.initialize(@major_radius, @minor_radius, @center, form:@form)
|
90
98
|
return
|
91
99
|
end
|
92
100
|
|
93
101
|
def move_vertically(distance)
|
94
102
|
@center = [@center[0], @center[1]+distance]
|
95
|
-
self.initialize(@major_radius, @minor_radius, @center)
|
103
|
+
self.initialize(@major_radius, @minor_radius, @center, form:@form)
|
96
104
|
return
|
97
105
|
end
|
98
106
|
end
|
99
107
|
end
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyllipse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burzum
|
@@ -40,5 +40,5 @@ requirements: []
|
|
40
40
|
rubygems_version: 3.1.2
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
|
-
summary: A gem for ellipses, this version excludes rotated ellipses.
|
43
|
+
summary: A gem for ellipses, this version excludes rotated ellipses. (fixed errors)
|
44
44
|
test_files: []
|