First commit
This commit is contained in:
2
IUT/Info1/TD/Exercices/5.6_courbure_terre/56.md
Normal file
2
IUT/Info1/TD/Exercices/5.6_courbure_terre/56.md
Normal file
@@ -0,0 +1,2 @@
|
||||
distance_homme² = distance_horizon² + rayon_terre²
|
||||
distance_horizon² = distance_homme²-rayon_terre²
|
||||
12
IUT/Info1/TD/Exercices/5.6_courbure_terre/distance.cpp
Normal file
12
IUT/Info1/TD/Exercices/5.6_courbure_terre/distance.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "distance.h"
|
||||
#include <cmath>
|
||||
|
||||
double Distance(double hauteur, double rayonPlanete) {
|
||||
double distanceHorizon;
|
||||
double distanceCentreHomme;
|
||||
|
||||
distanceCentreHomme = rayonPlanete + hauteur;
|
||||
distanceHorizon = pow(distanceCentreHomme, 2) - pow(rayonPlanete, 2);
|
||||
|
||||
return distanceHorizon;
|
||||
}
|
||||
1
IUT/Info1/TD/Exercices/5.6_courbure_terre/distance.h
Normal file
1
IUT/Info1/TD/Exercices/5.6_courbure_terre/distance.h
Normal file
@@ -0,0 +1 @@
|
||||
double Distance(double, double);
|
||||
BIN
IUT/Info1/TD/Exercices/5.6_courbure_terre/main
Normal file
BIN
IUT/Info1/TD/Exercices/5.6_courbure_terre/main
Normal file
Binary file not shown.
14
IUT/Info1/TD/Exercices/5.6_courbure_terre/main.cpp
Normal file
14
IUT/Info1/TD/Exercices/5.6_courbure_terre/main.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <iostream>
|
||||
#include "distance.h"
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
double hauteur;
|
||||
double rayonPlanete;
|
||||
double horizon;
|
||||
|
||||
cin >> hauteur >> rayonPlanete;
|
||||
|
||||
horizon = Distance(hauteur, rayonPlanete);
|
||||
cout << horizon;
|
||||
}
|
||||
Reference in New Issue
Block a user