geekhub_tasks 1.3.0 → 1.5.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/lib/geekhub_tasks.rb +16 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25673d57491f1fefd010dc5647bd10c65d47739ec13dd828924fbecf413878d1
|
4
|
+
data.tar.gz: f1ddbb1f215affd2ac08abc0463195cfb4c1fa4e4adec8d2f4ab9589faee1d9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9d9e62dfc706d01356872321d55436fa8b23684ac388967f80602193d921c8a364f230f11ced12bde75d10118668ea393b2561a333f02309d4edcf4ca3b0038
|
7
|
+
data.tar.gz: 53e355d9401e0399d32938837449b7a1a9fcf074d013f1a85cc7cc026af1ec9c7da6c014f1518af18f89aff00a114717943abe1de5fefe9dbdfc09e3cb3fa2b5
|
data/lib/geekhub_tasks.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class GeekHubTasks
|
2
2
|
|
3
|
-
def self.
|
3
|
+
def self.hyptenuse_triangle(a, b)
|
4
4
|
hypotenuse = Math.sqrt( ( a**2 ) + ( b**2 ) ).round(2)
|
5
5
|
area = ( a * b )/2
|
6
6
|
{ hypotenuse: hypotenuse, area: area }
|
@@ -27,11 +27,11 @@ class GeekHubTasks
|
|
27
27
|
{ s: s }
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.sides_triangle(
|
31
|
-
|
32
|
-
a = 2 * r * Math.sin(
|
33
|
-
b = 2 * r * Math.sin(
|
34
|
-
c = 2 * r * Math.sin(
|
30
|
+
def self.sides_triangle(a1, b1, r)
|
31
|
+
c1 = ( 180 - ( a1 + b1 ) )
|
32
|
+
a = 2 * r * Math.sin(a1 * ( Math::PI/180 ) ).round(2)
|
33
|
+
b = 2 * r * Math.sin(b1 * ( Math::PI/180 ) ).round(2)
|
34
|
+
c = 2 * r * Math.sin(c1.to_i * ( Math::PI/180 ) ).round(2)
|
35
35
|
{ a: a, b: b, c:c }
|
36
36
|
end
|
37
37
|
|
@@ -40,16 +40,16 @@ class GeekHubTasks
|
|
40
40
|
{ s: s }
|
41
41
|
end
|
42
42
|
|
43
|
-
def self.distance_between_two_points(
|
44
|
-
|
45
|
-
|
46
|
-
s = Math.sqrt(
|
43
|
+
def self.distance_between_two_points(x1, x2, y1, y2)
|
44
|
+
point1 = (x2 - x1)
|
45
|
+
point2 = (y2 - y1)
|
46
|
+
s = Math.sqrt(point1.to_i**2 + point2.to_i**2).round(2)
|
47
47
|
{ s: s }
|
48
48
|
end
|
49
49
|
|
50
|
-
def self.volume(
|
51
|
-
z =
|
52
|
-
t = ( (
|
50
|
+
def self.volume(v1, t1, v2, t2)
|
51
|
+
z = v1 + v2
|
52
|
+
t = ( ( v1 * t1 ) + ( v2 * t2 ) )/z.to_i
|
53
53
|
{ v: z,
|
54
54
|
t: t }
|
55
55
|
end
|
@@ -282,7 +282,7 @@ class GeekHubTasks
|
|
282
282
|
{ x1: x1, x2: x2 }
|
283
283
|
end
|
284
284
|
|
285
|
-
def self.
|
285
|
+
def self.redacted_text(n)
|
286
286
|
n.downcase!
|
287
287
|
if n.to_s.gsub!(/!/, ".")
|
288
288
|
s = "Your redacted string is #{n}"
|
@@ -378,7 +378,7 @@ class GeekHubTasks
|
|
378
378
|
{ r: r }
|
379
379
|
end
|
380
380
|
|
381
|
-
def self.
|
381
|
+
def self.hypot(v1, v2, a1, a2, s)
|
382
382
|
result = ( (-(v1+v2)+Math.sqrt( ( (v1+v2) ** 2 )+ 2 * ( a1 + a2 ) * s ) )/( a1 + a2 ) ).round(0)
|
383
383
|
{ result: result }
|
384
384
|
end
|
@@ -392,7 +392,7 @@ class GeekHubTasks
|
|
392
392
|
{ :p => p}
|
393
393
|
end
|
394
394
|
|
395
|
-
def self.
|
395
|
+
def self.child_children(n)
|
396
396
|
z = n.gsub!(/child/, "children")
|
397
397
|
{ :p => "#{z}" }
|
398
398
|
end
|