# Thread: two other python questions

1. Assign point_dist with the distance between point (x1, y1) and point (x2, y2). The calculation is: Distance = SquareRootOf( (x2 - x1)2 + (y2 - y1)2 ). Sample output for the given program:
Points distance: 3.0
Code:
``````import math

x1 = 1.0
y1 = 2.0
x2 = 1.0
y2 = 5.0
point_dist = 0.0

result

print('Points distance:', point_dist)``````

2nd question Simple geometry can compute the height of an object from the 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 for the given program:
Tree height: 13.5372315838

Code:
``````import math

angle_elev  = 3.8
tree_height = 0.0

print('Tree height:', tree_height)``````

2. The only thing you need to know here is python's syntax; the formulas to achieve the results you're after are given to you - apply them.

3. ## Thankful user:

4. Originally Posted by hc747
The only thing you need to know here is python's syntax; the formulas to achieve the results you're after are given to you - apply them.
solved the first problem now i can't solve the second

That's just really basic math and python?

6. ## Thankful user:

7. Originally Posted by Bartvh

That's just really basic math and python?
I got it lol

8. import math

x1 = 1.0
y1 = 2.0
x2 = 1.0
y2 = 5.0
point_dist = 0.0

point_dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)

print('Points distance:', point_dist)

9. i dont understand the point of this thread wth