hauteur_arbre.py

Created by ph-moutou

Created on May 17, 2024

279 Bytes

Pour évaluer la hauteur d’un arbre : choisir deux points alignés avec le pied de l’arbre, entrer les deux angles sous lesquels on relève le sommet de l’arbre depuis ces points puis la distance entre ces points. Le programme calcule alors la hauteur de l’arbre.


from math import tan,pi
a=int(input('entrer angle 1 (° entier): '))
b=int(input('entrer angle 2 (° entier): '))
d=int(input('entrer distance (m entier): '))
a=a*pi/180
b=b*pi/180
h=d*tan(a)*tan(b)/(tan(b)-tan(a))
if h<0 : h=-h
print('hauteur :',round(h),'m')

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.