weightlifting 0.0.2 → 0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/weightlifting.rb +11 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5aaeec3f60af79fcf3ec69cae2f4bd17781413c77d3989339d278c4c2ee8727
4
- data.tar.gz: f97c9bd3c67d1513bc75f78efd1ee76da4cc817413f74abea2f5358e3eac93bc
3
+ metadata.gz: cbdd4fab646cd909b20a73b3e94b8945c4e485a23dced70bfa73fa7757763044
4
+ data.tar.gz: 4781983024f007e409a4b28859281482ea4ae3fa0dc02690c4316a4a9a510af8
5
5
  SHA512:
6
- metadata.gz: 7a2d9bf9d334553f2b3e3bb0c19e761d5b77fba0ef87d0cab9dad9d8048a1092d02745c9445b81b434ce5067bd9ba2ea03e35ec164c5283beb459b876d0f7b44
7
- data.tar.gz: 9dd2b672a16027c62ea8bfa90443c1bea6a5538612b0a925663fdde6f8f77eb03b53e721004a8ece96c922610fb1707709f997e06771992108ffe64d2954d707
6
+ metadata.gz: a32fc38f7cf8e44200acacd2d454efb7e8a165c5f088a59d31dade369e3b35ea7140f5bb6cdead6cec93ce8575c74d78283965df28503e9d17c06a42c5dbafba
7
+ data.tar.gz: e61712b1588c98033657414fd15053d3734ec2177939043fe798e78c20a8e8735af77b62268a9664271d87809ca9bcbaadfbca964c41a78222bd3de23ac4a538
@@ -37,11 +37,22 @@ class Weightlifting
37
37
  wilkes(bodyweight_kg, 594.31747775582, -27.23842536447, 0.82112226871, -0.00930733913, 0.00004731582, -0.00000009054)
38
38
  end
39
39
 
40
+ def self.pounds_to_kilos(pounds)
41
+ pounds / 2.20462262185
42
+ end
43
+
44
+ def self.kilos_to_pounds(kilos)
45
+ kilos * 2.20462262185
46
+ end
47
+
40
48
  private
41
49
  # https://en.wikipedia.org/wiki/Sinclair_Coefficients
42
50
  # Sinclair Coefficient = 10^(-AX^2) and X = log_10(x/b)
43
51
  # x = Athletes bodyweight (kilograms)
44
52
  def self.sinclair(bodyweight, a, b)
53
+ if (bodyweight >= b)
54
+ 1.0
55
+ end
45
56
  @coefficient = 10**(a * (Math::log10(bodyweight/b)**2))
46
57
  end
47
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weightlifting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Pitts