CPSC120B
Fundamentals of Computer Science I

Post-lab 10

Modules

The American Forests Big Tree program maintains a database of the largest trees of hundreds of species for states in the US. Determining the size of a tree consists of measuring the height, girth, and spread of a tree. Measuring the height of a tree is accomplished by using clinometer to measure the the angle of a line of sight to the top of the tree.

Details

Write a Python program that prompts the user for the angle measure from a clinometer, the height inches the clinometer is from the ground, and the distance (in inches) the clinometer is from the tree. Then print the height of the tree using the following equation:

\[ h_c + d \cdot tan(\theta) = h_t \]

Where d is the distance from the clinometer to the tree, \(\theta\) is the clinometer angle (in degrees), \(h_c\) is the height of the clinometer, and \(h_t\) is the height of the tree.

    $ python3 tree.py
    d? 3600
    clinometer height? 66
    clinometer angle? 51
    That tree is 4511.629763526185 inches tall

Submission

Submit your code on the course Inquire site.