16 double _length, _mass;
28 if (l <= 0 || m <= 0) {
29 throw std::domain_error(__func__);
37 double length()
const {
return _length; }
43 double mass()
const {
return _mass; }
50 using namespace gravitation;
53 const double T0 = 2 *
Math::PI * std::sqrt(p.length() / Earth::g);
54 std::cout << p.length() << std::endl;
55 std::cout << p.mass() << std::endl;
56 std::cout << T0 << std::endl;
double length() const
length Zugriff auf interne Variable
double mass() const
mass Zugriff auf interne Variable
Pendulum(double l, double m)
Pendulum Konstruktor.
void ex1()
ex1 Beispiel: Eigenschaften eines mathematischen Pendels
The Pendulum class Eigenschaften eines mathematischen Pendels.
static constexpr double PI