Welcome to Westonci.ca, the ultimate question and answer platform. Get expert answers to your questions quickly and accurately. Ask your questions and receive accurate answers from professionals with extensive experience in various fields on our platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

in python Simple geometry can compute the height of an object from the object's shadow length and shadow angle using the formula: tan(angleElevation) = treeHeight / shadowLength. Given the shadow length and angle of elevation, compute the tree height.

Sample output with inputs: 0.4 17.5
Tree height: 7.398881327917831

Sagot :

Answer:

import math

angle = float(input('Enter Angle: '))

shadowLength = float5(input('Enter Shadow Length: '))

tree_height = math.tan(angle)*shadowLength

print('Tree Height = {}'.format(tree_height))

Explanation:

From the equation given, the first step is to derive the equation for calculating the Tree Height.

In order to calculate the tangent of an angle, the math module has to be imported. math module allows the program to perform advanced math operations.

The program then prompts the user to input values for angle and shadow length.

The inputted values are converted to floats and used in the equation that was derived for Tree height.

Three height is evaluated and the result is printed to the screen

View image Maria23000984