Slide 38
Slide 38 text
RC(SABRΑΓൈਮ)
def rc(cls, tb, h, bb, hbp, cs, gidp, sf, sh, sb, so, ab, ibb):
"""
Runs Created
:param tb: total bases
:param h: hits
:param bb: base on ball
:param hbp: hit by pitch
:param cs: caught stealing
:param gidp: ground into duble play
:param tb: total bases
:param sf: sacrifice fly
:param sh: sacrifice hit
:param sb: stolen base
:param so: strike out
:param ab: at bat
:param ibb: intentional base on balls
:return: (float) run created
"""
# (ग़ྥೳྗA * ਐྥೳྗB) / ग़ྥػձC
a = float(h + bb + hbp - cs - gidp)
b = float(tb) + round(0.24 * float(bb + hbp - ibb), 1) + round(0.62 * float(sb), 1)\
+ round(0.5 * float(sh + sf), 1) - round(0.03 * float(so), 1)
c = float(ab + bb + hbp + sf + sh)
a_b = round(a + 2.4 * c) * (b + 3.0 * c)
_9c = round(9.0 * c, 1)
_09c = round(0.9 * c, 1)
rc = round(a_b / _9c - _09c, 2)
return rc