Tree height measurement Task 171

Back to Problem Solutions forum

aditya_tomar     2020-06-30 13:00:28

Can somebody explain me what is angle b in this problem

qwerty     2020-06-30 14:25:05

Угол b - это угол между линией зрения лесника, когда он смотрит на верхушку дерева, и нитью, на которой подвешен грузик. (The angle b is the angle between the line of sight (to the top) and the vertical line given by plumb.)

aditya_tomar     2020-06-30 15:17:00

But in the figure, when the angle b is clearly acute why is the vertical plumb pointing at around 125 degrees

qwerty     2020-06-30 17:43:52

You should continue the line of sight and measure angle from right part of line to plumb, not from left part of line to plumb. Sorry if what I said is not clear enough, my English is bad.

aditya_tomar     2020-06-30 18:18:32

so let's say plumb angle = 125 (as given in the figure) the angle between the plumb and the line of sight should be 180 - 125 = 55 I am considering here three angles enclosed in a triangle. First one is between the line of sight and horizontal which I have to find . Second one is the one with the vertical plumb (which should be 90 degress) and the third one the angle between the plumb and the line of sight 55 degrees

So according to triangle sum property- the angle between the line of sight and horizontal should be 180 - 90 - 55 = 35 degrees

Please correct me where I am wrong

qwerty     2020-06-30 22:30:05

It look like your calculations are correct.

aditya_tomar     2020-07-01 00:00:05

But when I put it in the formula I get the wrong answer

Hyuto     2020-07-01 05:30:51
User avatar

I think the calculation is correct. Idk where's the problem, because the answer that you submit is just 'pass' statement. But let me guess that you didnt change the degree format to radians before calculating with tan.

aditya_tomar     2020-07-01 09:21:15

That is my code

from math import tan data = '''71 134.182 47 139.994 121 109.983'''.split('\n') data = [d.split() for d in data] for item in data: angle = 90 - (180 - float(item[0])) angle = angle(3.142/180) distance = float(item[1]) height = math.ceil(tan(angle)distance) print(height,end= ' ')

qwerty     2020-07-01 10:18:08

Maybe not enough precision. How about trying math.pi instead of value 3.142?

aditya_tomar     2020-07-01 10:24:36

Also did that, getting these values -46 -130 67

qwerty     2020-07-01 12:41:07

Angle specified in position with index 1 in each row of data, not in position with index 0. Distance in position index 0, not position index 1. To get the nearest integer, the function round() is needed (not math.ceil()).

Hyuto     2020-07-01 12:47:45
User avatar

angle = 90 - (180 - float(item[0]))<br /> based on your formula above isn't it be: angle = 180 - 90 - (180 - float(item[0]))<br /> Also you don't have to post your code here. Just submit your code at the code area in the question page so only poeple who've clear the problem can see it. :)

aditya_tomar     2020-07-01 12:51:07

Thanks a lot bro!!! I was just stuck up on this question and I didn't realize that I was putting the wrong values each time

aditya_tomar     2020-07-01 12:52:38

i have just simplified it hyuto. My mistake was that I was using the wrong values

Please login and solve 5 problems to be able to post at forum