この関数のコードを書き込もうとしていますがasin
、python 2.7 で作業することができません。なぜアイデアはありますか?
import math
from decimal import *
def main():
H = raw_input ("Please enter hight:")
H = int(float(H))
m = raw_input ("Please enter crest thickness:")
m = int(float(m))
n = raw_input ("Please enter base thikness:")
n = int(float(n))
Fx = 0.0
Fy = 0.0
Magnitude = 0.0
Direction = 0.0
p = 1000 #dencity
g = 9.81 #gravity
R = math.sqrt(H*H + n*n)
#Force in x direction
Fx = (-p*g*m*(H*H))/2.0
#Force in y direction
Fy = -p*g*R*(((math.asin(n/H))/2.0)-sin((2*math.asin(n/H))/4.0))
#Overall force
Direction = math.atan(Fy/Fx)
Magnitude = sqrt(Fx*Fy + Fy*Fy)
print ("The force magnitude is", Magnitude)
print ("The force direction is", Direction)