+ 1
Mathematical Applications in Python
Given a right pyramid, defined as a right pyramid with a squared base, with the vertex above the centrist of the base, I would like to compute the angle between a lateral face and the base. But, the code below didn't work out, could someone figure it out? import math h = eval(input("please input the pyramid's height")) l = eval(input("please input the pyramid's base side ")) math.atan(x) = h/((l/2)**2 + h**2) ** (1/2) print("the angle between a lateral face and the base is", round(x, 4)) Thanks Art for the code! https://code.sololearn.com/c7ufu0mNU7NC/?ref=app
5 odpowiedzi
+ 6
try this:
x = math.tan(h/((l/2)**2 + h**2) ** (1/2))
+ 5
I just tried finding x in that equation and my geometry isn't good enough so I can't explain it :(
and my answer can be false I'm not sure
+ 2
What's the shape of the base of the pyramid? Equilateral triangle? Square? Something else?
And by "edge", do you mean lateral edge?
If you can't translate terms properly from Chinese, perhaps Flandre Scarlet can help you?
0
thanks for answering, but why could tan(sinθ) be the angle x ?
0
angela852030 please try this code and inform me is that good enough for you...(this is for square base and h is from centre of gravity,result will be different with base shape and h's starting point.)
https://code.sololearn.com/c7ufu0mNU7NC/?ref=app