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.
- checksums.yaml +4 -4
- data/lib/weightlifting.rb +52 -5
- 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: 33bd23b59ceb2d350728381f95f089c4c32a20b33240ead8e3da54b1d405709f
|
|
4
|
+
data.tar.gz: 72bdef5fe8b89030c2b00228ee9b7024a3ce8e34fa9a2a31994e58d91fa8e9e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e02416213321c5412d951a03468595ce710286cee28ce5b139853c489594e1769113048892f3721183c0caa7a241b505678b5ebf61c0f6d8d3f02c675afc91d4
|
|
7
|
+
data.tar.gz: a5a1d5ea0f2ec3ad3fdd3db0c8bf951f4c5554c007ed2f6cb11d4d5d766580ca6b16c2d27b012a1d6690c38ee772587f6fc569d1829128cb538f8f91347ac546
|
data/lib/weightlifting.rb
CHANGED
|
@@ -1,7 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
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: {}
|