diff --git a/sizebot/cogs/stats.py b/sizebot/cogs/stats.py index a5d94398..1e925852 100644 --- a/sizebot/cogs/stats.py +++ b/sizebot/cogs/stats.py @@ -528,7 +528,7 @@ async def fall(self, ctx: BotContext, distance: MemberOrFakeOrSize): userdata = userdb.load(ctx.guild.id, ctx.author.id) basemass = userdata.baseweight scale = userdata.scale - time, vm, fl = freefall(basemass, distance, scale) + time, vm = freefall(basemass, distance, scale) ftime = pretty_time_delta(time, millisecondAccuracy = True, roundeventually = True) await ctx.send(f"You fell **{distance:,.3mu}** in **{ftime}**!\n" diff --git a/sizebot/lib/freefall.py b/sizebot/lib/freefall.py index dc5d7e24..a5c94afc 100644 --- a/sizebot/lib/freefall.py +++ b/sizebot/lib/freefall.py @@ -6,7 +6,7 @@ from sizebot.lib.units import TV, WV, SV -def freefall(basemass: WV, altitude: SV, scale: Decimal) -> Tuple[Decimal, Decimal, Decimal]: +def freefall(basemass: WV, altitude: SV, scale: Decimal) -> Tuple[Decimal, Decimal]: """ If dropped, how long does it take for person to hit ground @@ -17,7 +17,6 @@ def freefall(basemass: WV, altitude: SV, scale: Decimal) -> Tuple[Decimal, Decim returns tuple of: Time of fall (secs) Maximum velocity (m/s) - Terminal velocity (m/s) """ basemass = basemass / Decimal(1000) m = basemass * (scale ** Decimal(3)) @@ -28,15 +27,7 @@ def freefall(basemass: WV, altitude: SV, scale: Decimal) -> Tuple[Decimal, Decim t = Decimal(math.sqrt(m / (g * k))) * Decimal(math.acosh(Decimal(math.exp(h * k / m)))) vel = Decimal(math.sqrt(g * m / k)) * Decimal(math.tanh(t * Decimal(math.sqrt(g * k / m)))) - # calculate feelslike - TWENTY_FIVE_SIXTHS = Decimal(25) / Decimal(6) - step2 = Decimal(math.sqrt(Decimal(1) / basemass)) - step3 = Decimal(math.sqrt(basemass)) - step4 = Decimal(math.atanh((Decimal("0.156436") * vel) / Decimal(math.sqrt(basemass)))) - step5 = -Decimal(math.cosh(step2 * step3 * step4)) - feelslike = m * Decimal(math.log(Decimal(math.pow(-step5, TWENTY_FIVE_SIXTHS)))) - - return TV(t), SV(vel), SV(feelslike) + return TV(t), SV(vel) # https://www.omnicalculator.com/physics/free-fall-air-resistance#how-to-calculate-air-resistance # If dropped, how long does it take for person to hit ground @@ -59,10 +50,7 @@ def freefall(basemass: WV, altitude: SV, scale: Decimal) -> Tuple[Decimal, Decim # OUT # t Time of fall ? sec # vel Maximum velocity ? m/s -# vmax Terminal Velocity ? m/s # # g = 9.807 # t = sqrt(m/(g*k))*acosh(exp(h*k/m)) # vel = sqrt(g*m/k)*tanh(t*sqrt(g*k/m)) -# vmax = sqrt(g*m/k) -# feelslike = m * log(-(-cosh(sqrt(1/m) * sqrt(m) * atanh((0.156436 * v)/sqrt(m))))**(25/6)) diff --git a/tests/test_freefall.py b/tests/test_freefall.py index f5f67bfc..8c7391a9 100644 --- a/tests/test_freefall.py +++ b/tests/test_freefall.py @@ -3,7 +3,6 @@ def test_freefall_type(): - t, vel, feelslike = freefall(Decimal(1), Decimal(1), Decimal(1)) + t, vel = freefall(Decimal(1), Decimal(1), Decimal(1)) assert isinstance(t, Decimal) assert isinstance(vel, Decimal) - assert isinstance(feelslike, Decimal)