37 lines
854 B
C++
37 lines
854 B
C++
#include <string>
|
|
using namespace std;
|
|
|
|
#pragma once
|
|
|
|
// Parametrierung der auf den Körper wirkende Kräfte:
|
|
class Vektor {
|
|
public:
|
|
float x; // [m/s^2]
|
|
float y; // [m/s^2]
|
|
Vektor() = default;
|
|
Vektor(float x, float y) {
|
|
this->x = x;
|
|
this->y = y;
|
|
}
|
|
void add(const Vektor &vec2);
|
|
void ausgabeVektor(const Vektor &vec);
|
|
void mul(const float &skalar);
|
|
};
|
|
// Körper:
|
|
class Koerper {
|
|
public:
|
|
float masse; // [kg]
|
|
Vektor position;
|
|
Vektor geschwindigkeit;
|
|
Koerper(float masse, Vektor position, Vektor geschwindigkeit) {
|
|
this->masse = masse;
|
|
this->position = position;
|
|
this->geschwindigkeit = geschwindigkeit;
|
|
};
|
|
float liefereMasse();
|
|
void bewegen(const Vektor &gesamtkraft, const float &dt);
|
|
Vektor lieferePosition();
|
|
Vektor liefereGeschwindigkeit();
|
|
string text();
|
|
};
|