In Python please:
Simple geometry can compute the height of an object from the object's shadow length and shadow angle using the formula:
tan(angleElevation) = tree_height / shadow_length. Given the shadow length and angle of elevation, compute the tree height.
Sample output with inputs: 0.4 17.5
Tree height: 7.398881327917831

Respuesta :

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.

[tex]tan(angleElevation) = tree height / shadow length\\\\tree height = tan(angleElevation) * shadow length[/tex]

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

Ver imagen jehonor

The program is an illustration of trigonometry ratios.

The program in Python, where comments are used to explain each line is as follows:

#This imports the math module

import math

#This gets input for angle

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

#This gets input for the length of the shadow

shadow_length = float(input('Shadow Length: '))

#This calculates the tree height

tree_height = math.tan(angle)*shadow_length

#This prints the tree height

print('Tree Height:',tree_height)

At the end of the program, the tree height is printed.

Read more about similar programs at:

https://brainly.com/question/16374060

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE