Erinnerung: Folgendes soll funktionieren:
Point a = ...;
Point b = ...;
double d = ...;
a = a + b;
a = a - b;
a += b;
a -= b;
a = d*b;
a = b*d;
a *= d;
std::cout << a << std::endl;
#ifndef NBODY_SIM_POINT_H
#define NBODY_SIM_POINT_H
#include <iostream>
struct Point {
// coordinates
double x;
double y;
public:
Point();
Point(double x_p, double y_p);
Point operator+(const Point& b);
Point operator-(const Point& b);
Point& operator*=(double d);
Point& operator+=(const Point& b);
Point& operator-=(const Point& b);
friend Point operator*(const double& d, const Point& b);
friend Point operator*(const Point& b, const double& d);
friend std::ostream& operator<<(std::ostream& os, const Point& a);
};
#endif //NBODY_SIM_POINT_H
Erinnerung:
Implementieren Sie eine Lambda Funktion in der Funktion "simulateNBody" in der Datei "nbody.h".
Sonst gerne auch gleich in der Übungsphase!