废话少说,代码自取。
'''
import math
def calculate_v(a, b, d, e):
"""
Calculate the value of V based on the given formula.
:param a: Caliber (口径)
:param b: Mass (质量)
:param d: Impact angle (着角)
:param e: Thickness (厚度)
:return: Calculated value of V
"""
v = 0.3048 * ((6 * e / a - 2.7) * (d ** 2 + 2000) + 40000) * (e / 25.4) ** 0.5 * a / 25.4 / (41.57 * (b / 0.45359237) ** 0.5 * math.cos(d / 57.3))
return v
def main():
# Requesting user input
a = float(input("请输入口径: "))
b = float(input("请输入弹重: "))
d = float(input("请输入着角: "))
e = float(input("请输入板厚: "))
# Calculating V
v = calculate_v(a, b, d, e)
# Displaying the result
print("经验式击穿速度值为: {:.2f}".format(v),"m/s")
if __name__ == "__main__":
main()
'''
用者自取
'''
import math
def calculate_v(a, b, d, e):
"""
Calculate the value of V based on the given formula.
:param a: Caliber (口径)
:param b: Mass (质量)
:param d: Impact angle (着角)
:param e: Thickness (厚度)
:return: Calculated value of V
"""
v = 0.3048 * ((6 * e / a - 2.7) * (d ** 2 + 2000) + 40000) * (e / 25.4) ** 0.5 * a / 25.4 / (41.57 * (b / 0.45359237) ** 0.5 * math.cos(d / 57.3))
return v
def main():
# Requesting user input
a = float(input("请输入口径: "))
b = float(input("请输入弹重: "))
d = float(input("请输入着角: "))
e = float(input("请输入板厚: "))
# Calculating V
v = calculate_v(a, b, d, e)
# Displaying the result
print("经验式击穿速度值为: {:.2f}".format(v),"m/s")
if __name__ == "__main__":
main()
'''
用者自取