Answer:
treeHeight = tangent of angleElevation * treeDistance
In java, we could write it as:
double treeHeight = (Math.tan(angleElevation) * treeDistance);
Math.tan(angleElevation) is an inbuilt java mathematical function used to calculate the tangent of a value and the return value is always double.
Explanation:
formula:
tangent of angleElevation = treeHeight/treeDistance
We want to assign treeHeight, so we cross-multiply and we get:
treeHeight = tangent of angleElevation * treeDistance
Off course, the treeHeight will be in feet also.