任务描述
根据下面公式
计算并输出x的值(精确保留两位小数,保留输出数字末尾的0),a和b的值由用户输入,括号里的数字是角度值, 要求圆周率的值使用数学常数math.pi,开平方使用math库中开平方函数,三角函数的值用math库中对应的函数进行计算 。
输入格式
输入包括两行, 每行一个数字。
输出格式
表达式的值
import math
a = float(input())
b = float(input())
sin60 = math.sin(math.radians(60))
cos60 = math.cos(math.radians(60))
x1 = 2 * a * sin60 * cos60
x2 = math.sqrt(x1)
x3 = x2 - b
x4 = 2*a
x = x3/x4
print("{:.2f}".format(x))