18 std::cout << std::scientific << std::setprecision(3);
21 std::cout <<
"phi [deg]" 22 << std::setw(15) <<
"phi [rad]" 23 << std::setw(15) <<
"cos(phi)" 24 << std::setw(15) <<
"sin(phi)" 25 << std::setw(15) <<
"tan(phi)" << std::endl;
27 for (
double phi = 0; phi <= 90; phi += 30) {
30 << std::setw(15) << phiRad
31 << std::setw(15) << cos(phiRad)
32 << std::setw(15) << sin(phiRad);
34 std::cout << std::setw(15) <<
"nan" << std::endl;
36 std::cout << std::setw(15) << tan(phiRad) << std::endl;
45 using namespace gravitation;
47 std::cout << std::scientific << std::setprecision(3);
49 std::cout <<
"alpha" << std::setw(12) <<
"r" << std::setw(12)
50 <<
"force" << std::setw(12) <<
"g1" << std::setw(12)
51 <<
"g1/g0" << std::endl;
53 for (
double alpha : { 1.55, 1.75, 1.81, 1.92 }) {
54 const double c = 1 + alpha;
55 const double r = alpha * Earth::radius;
56 const double force = Astronomy::G * Earth::mass * m / pow(r, 2);
57 const double g1 = Earth::g / pow(c, 2);
58 std::cout << alpha << std::setw(12) << r << std::setw(12)
59 << force << std::setw(12) << g1 << std::setw(12)
60 << g1 / Earth::g << std::endl;
69 using Item = std::pair<double, double>;
71 std::vector<Item> values;
73 for (
double a = 2; a < 50; a += 1) {
74 values.push_back({ a, std::pow(a, 1.5) });
80 d = (d == 10) ? 1 : d + 1;
84 for (
const auto &item : values) {
86 std::cout <<
"(" << item.first <<
"," 99 static double val = 0;
105 std::generate_n(values, n, fn);
107 for (
auto x : values) {
108 std::cout << x <<
",";
110 std::cout << std::endl;
void ex3()
ex3 Umlaufzeit eines Planeten innerhalb des Sonnensystems
void ex2()
ex2 Satellit auf kreisförmiger Bahn um die Erde
void ex4()
ex4 Speicherung und Ausgabe von n geraden Zahlen
void ex1()
ex1 Umrechnung Bogen- und Gradmaß
static double to_radians(double x)
static constexpr double PI
static int cmp(double x, double y, double epsilon)