physique: etage nival a partir de 2800 m
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
a5083a696d
révision
01660947f4
1 fichier modifié
+4
-2
@@ -47,13 +47,13 @@ pub fn decalage_exposition_m(e: Exposition) -> f32 {
|
||||
}
|
||||
|
||||
/// Etage de vegetation (Prealpes du Nord) [A VERIFIER] : collinéen < 700, montagnard 700-1500
|
||||
/// (hetre-sapin), subalpin 1500-1900 (epicea, pin a crochets), alpin 1900-2400, nival au-dela.
|
||||
/// (hetre-sapin), subalpin 1500-1900 (epicea, pin a crochets), alpin 1900-2800, nival au-dela (non atteint dans le Vercors, max 2341 m ; l ubac n y arrive pas non plus).
|
||||
pub fn etage_vegetation(alt_m: f32, expo: Exposition) -> Etage {
|
||||
let a = alt_m - decalage_exposition_m(expo);
|
||||
if a < 700.0 { Etage::Collineen }
|
||||
else if a < 1500.0 { Etage::Montagnard }
|
||||
else if a < 1900.0 { Etage::Subalpin }
|
||||
else if a < 2400.0 { Etage::Alpin }
|
||||
else if a < 2800.0 { Etage::Alpin }
|
||||
else { Etage::Nival }
|
||||
}
|
||||
|
||||
@@ -125,6 +125,8 @@ mod tests {
|
||||
assert_eq!(etage_vegetation(1000.0, Exposition::Neutre), Etage::Montagnard);
|
||||
assert_eq!(etage_vegetation(1700.0, Exposition::Neutre), Etage::Subalpin);
|
||||
assert_eq!(etage_vegetation(2100.0, Exposition::Neutre), Etage::Alpin);
|
||||
assert_eq!(etage_vegetation(2341.0, Exposition::Ubac), Etage::Alpin); // sommet du Vercors : jamais nival
|
||||
assert_eq!(etage_vegetation(2900.0, Exposition::Neutre), Etage::Nival);
|
||||
assert_eq!(etage_vegetation(1600.0, Exposition::Ubac), Etage::Subalpin);
|
||||
assert_eq!(etage_vegetation(1600.0, Exposition::Adret), Etage::Montagnard);
|
||||
}
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur