+ 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

28th Oct 2018, 3:49 PM
angela852030
angela852030 - avatar
5 odpowiedzi
+ 6
try this: x = math.tan(h/((l/2)**2 + h**2) ** (1/2))
28th Oct 2018, 3:59 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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
28th Oct 2018, 4:37 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 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?
28th Oct 2018, 5:26 PM
Kishalaya Saha
Kishalaya Saha - avatar
0
thanks for answering, but why could tan(sinθ) be the angle x ?
28th Oct 2018, 4:12 PM
angela852030
angela852030 - avatar
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
28th Oct 2018, 6:26 PM
Art