Dies ist eine alte Version des Dokuments!
← zurück zur Liste der Komponenten
Die Klasse Vector3D ist die Grundlage für alle Größen der Berechnungen wie Positionen, Geschwindigkeiten, Beschleunigungen und Kräfte.
Unser Vector3D bietet folgende Funktionalitäten:
class Vector3D { private: // DEKLARATION DER ATTRIBUTE double x,y,z; public: // KONSTRUKTOREN Vector3D(); Vector3D(double, double, double); // GETTER double getX() const; double getY() const; double getZ() const; // SETTER void setX(double); void setY(double); void setZ(double); // OPERATORUEBERLADUNGEN Vector3D operator+(const Vector3D &a) const; Vector3D operator-(const Vector3D &a) const; Vector3D operator*(const double) const; Vector3D operator/(double) const; bool operator== (const Vector3D) const; // SONSTIGE FUNKTIONEN double betrag(); double skalarprodukt(Vector3D &a); double winkel(Vector3D &a); double abstand (const Vector3D &a); Vector3D kreuzprodukt(Vector3D &a) const; double spatprodukt(Vector3D &a, Vector3D &b); Vector3D norm(); std::string asString() const; };