python方程计算与exp()函数

问题描述

这是我要解的方程:

original

最正确的答案是0.347,这就是我得到的:

from math import *

exp(((-4.4 + 0.6*(0.6/1.2))*tan(25)) + ((3.07*sin(25))*(log(2*4.29))/(1+sin(25))))

输出:

0.6318

我尝试使用弧度:tan(radians(25)) 我总是得到错误的结果

解决方法

0.347(忽略舍入误差)是正确的,如果您使用以 10 为底的对数,并且三角函数的参数以度为单位。
0.6318 适用于自然对数和弧度。

>>> from math import exp,log,sin,tan,radians
>>> exp(((-4.4 + 0.6*(0.6/1.2))*tan(radians(25))) + ((3.07*sin(radians(25)))*(log(2*4.29,10))/(1+sin(radians(25)))))
0.34627767629783546

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...