weightlifting 0.0.0 → 0.0.1

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 +52 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29dfd92e0e3c2b7bfc1ba4a4bddd4e4aec7c2ce315b799dd20b89d00c29c1c38
4
- data.tar.gz: 7edea9cb7aa2544ad2705cdf4418be9c2aefccb8e95c667cb90c06fcbe524b31
3
+ metadata.gz: 33bd23b59ceb2d350728381f95f089c4c32a20b33240ead8e3da54b1d405709f
4
+ data.tar.gz: 72bdef5fe8b89030c2b00228ee9b7024a3ce8e34fa9a2a31994e58d91fa8e9e9
5
5
  SHA512:
6
- metadata.gz: df244a30a192d7012d0d2a7a6d054112530d314678a6eed556f55b1c96f275540ee057cd35d1d2f6dc51f182cb47f921f9bf977a83f8705173da446baa560b0c
7
- data.tar.gz: fc73d817c50558b1014b64d44d1c39de131617cb977ee18d16cb36bb6c9840e47817974019dead8812388bd138cf39e9dd18e4b80387a453e6182f163882444a
6
+ metadata.gz: e02416213321c5412d951a03468595ce710286cee28ce5b139853c489594e1769113048892f3721183c0caa7a241b505678b5ebf61c0f6d8d3f02c675afc91d4
7
+ data.tar.gz: a5a1d5ea0f2ec3ad3fdd3db0c8bf951f4c5554c007ed2f6cb11d4d5d766580ca6b16c2d27b012a1d6690c38ee772587f6fc569d1829128cb538f8f91347ac546
data/lib/weightlifting.rb CHANGED
@@ -1,7 +1,54 @@
1
- module Weightlifting
2
- class WhoIs
3
- def self.awesome?
4
- puts "YOU ARE AWESOME!!"
5
- end
1
+ class Weightlifting
2
+
3
+ # MEN:
4
+ # A = 0.751945030
5
+ # b = 175.508 kg
6
+ #
7
+ def self.sinclair_coeff_male(bodyweight_kg)
8
+ sinclair(bodyweight_kg, 0.751945030, 175.508)
9
+ end
10
+
11
+ # WOMEN:
12
+ # A = 0.783497476
13
+ # b = 153.655 kg
14
+ def self.sinclair_coeff_female(bodyweight_kg)
15
+ sinclair(bodyweight_kg, 0.783497476, 153.655)
16
+ end
17
+
18
+ # Values for men are:
19
+ # a=-216.0475144
20
+ # b=16.2606339
21
+ # c=-0.002388645
22
+ # d=-0.00113732
23
+ # e=7.01863E-06
24
+ # f=-1.291E-08
25
+ def self.wilkes_coeff_male(bodyweight_kg)
26
+ wilkes(bodyweight_kg, -216.0475144, 16.2606339, -0.002388645, -0.00113732, 0.00000701863, -0.00000001291)
6
27
  end
28
+
29
+ # Value for women are:
30
+ # a=594.31747775582
31
+ # b=-27.23842536447
32
+ # c=0.82112226871
33
+ # d=-0.00930733913
34
+ # e=4.731582E-05
35
+ # f=-9.054E-08
36
+ def self.wilkes_coeff_female(bodyweight_kg)
37
+ wilkes(bodyweight_kg, 594.31747775582, -27.23842536447, 0.82112226871, -0.00930733913, 0.00004731582, -0.00000009054)
38
+ end
39
+
40
+ private
41
+ # https://en.wikipedia.org/wiki/Sinclair_Coefficients
42
+ # Sinclair Coefficient = 10^(-AX^2) and X = log_10(x/b)
43
+ # x = Athletes bodyweight (kilograms)
44
+ def self.sinclair(bodyweight, a, b)
45
+ @coefficient = 10**(a * (Math::log10(bodyweight/b)**2))
46
+ end
47
+
48
+ # https://en.wikipedia.org/wiki/Wilks_Coefficient
49
+ # 500 / (a + bx^2 + cx^3 + dx^4 + ex^5 + fx^6)
50
+ # x = Athletes bodyweight (kilograms)
51
+ def self.wilkes(bodyweight, a, b, c, d, e, f)
52
+ 500 / (a + (b * bodyweight) + (c * bodyweight**2) + (d * bodyweight**3) + (e * bodyweight**4) + (f * bodyweight**5))
53
+ end
7
54
  end
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.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Pitts
@@ -18,7 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/weightlifting.rb
21
- homepage:
21
+ homepage: https://rubygems.org/gems/hola
22
22
  licenses:
23
23
  - MIT
24
24
  metadata: {}