我正在 handcalcs Python 库中使用 forallpeople Python 库。进行平方根计算后,计算结果中没有显示单位:
import handcalcs.render
from math import sqrt, pi
import forallpeople as si
si.environment('structural', top_level=True)
计算如下:
%%render 1 short
A = (78.3*MPa)
B = (56.6*MPa)
C = (80.4*MPa)
D = sqrt(A**2 + B**2 + C**2)
这是输出:
我想知道是否有办法让单位显示出来,即
D = ... = 125.7 MPa
我按照
forallpeople
手册进行操作,其中有策略1 - 手动重新添加单位并且它起作用了。
%%render 1 short
A = (78.3*MPa)
B = (56.6*MPa)
C = (80.4*MPa)
D = (sqrt(A**2 + B**2 + C**2)*MPa)