【发布时间】:2013-09-14 02:10:32
【问题描述】:
您将获得直径,以及段或弦的长度。我的问题的直径是 12,弦是 10。你必须找到阴影段的高度,然后打印该区域。原来的公式是A=2/3ch + h^3/2c。我的同学在该地区得到了 18,但当我使用我的代码时,我得到了 41。
这是我能找到的最接近的图片表示。但是从ϴ 到s. 之间有一条虚线
from math import sqrt
diamStr=input("Enter the length of the diameter: ")
diameter=int(diamStr)
chordStr = input( " Enter the chord length: ")
chord = int(chordStr)
radius = (diameter/2)
s = sqrt (diameter**2+chord**2)
h = (s/2-radius)
i= (2/3*chord*h)
j=(h**3/2*chord)
area = (i+j)
print (area)
【问题讨论】:
-
未在问题中找到任何问号。
-
@SargeBorsch 这是“没找到”。 (SCNR)
-
@glglgl 谢谢。有时我的英语有问题。
-
@To_the_oop 你想使用什么样的方程?如果您指出一些网络资源表明该等式是计算分段面积的有效方法,也许我可以将我的解决方案转换为那个难以理解的等式......
标签: python python-3.x