Compare commits
No commits in common. "cf97b0ac1efde01580bc1cacabcdaa7d5d4213e3" and "a7a85287d084a69b7eff1579cb6d9dd3e30c6cab" have entirely different histories.
cf97b0ac1e
...
a7a85287d0
Binary file not shown.
@ -4,39 +4,4 @@
|
|||||||
#include "flugkurve03.h"
|
#include "flugkurve03.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
//to be implemented
|
||||||
void Vektor::mul(const float &skalar){
|
|
||||||
this->x *= skalar;
|
|
||||||
this->y *= skalar;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Vektor::add(const Vektor &vec2) {
|
|
||||||
this->x += vec2.x;
|
|
||||||
this->y += vec2.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Koerper::bewegen(const Vektor &beschleunigung,const float &dt) {
|
|
||||||
// Ermittlung der neuen Geschwindigkeit
|
|
||||||
this->geschwindigkeit.x += dt * beschleunigung.x;
|
|
||||||
this->geschwindigkeit.y += dt * beschleunigung.y;
|
|
||||||
|
|
||||||
// Ermittlung der neuen Position
|
|
||||||
this->position.x += dt * this->geschwindigkeit.x ;
|
|
||||||
this->position.y += dt * this->geschwindigkeit.y ;
|
|
||||||
}
|
|
||||||
float Koerper::liefereMasse(){
|
|
||||||
return this->masse;
|
|
||||||
}
|
|
||||||
Vektor Koerper::lieferePosition(){
|
|
||||||
return this->position;
|
|
||||||
}
|
|
||||||
Vektor Koerper::liefereGeschwindigkeit(){
|
|
||||||
return this->geschwindigkeit;
|
|
||||||
}
|
|
||||||
string Koerper::text(){
|
|
||||||
string outputX = to_string(this->position.x);
|
|
||||||
string outputY = to_string(this->position.y);
|
|
||||||
stringstream ganzeOut;
|
|
||||||
ganzeOut << "X= " << outputX << " Y= " << outputY;
|
|
||||||
return ganzeOut.str();
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,36 +1,4 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#pragma once
|
// to be defined
|
||||||
|
|
||||||
// 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();
|
|
||||||
};
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user