Skip to content

Instantly share code, notes, and snippets.

@Ben1980
Created March 5, 2019 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben1980/86ac75a645d09fe65a6b815170e2b2b1 to your computer and use it in GitHub Desktop.
Save Ben1980/86ac75a645d09fe65a6b815170e2b2b1 to your computer and use it in GitHub Desktop.
class Particle {
public:
Particle();
Particle(double mass, const Vector2D &acceleration, const Vector2D &velocity, const Vector2D &position);
bool operator==(const Particle &rhs) const;
bool operator!=(const Particle &rhs) const;
double getMass() const;
const Vector2D &getAcceleration() const;
void setAcceleration(const Vector2D &acceleration);
const Vector2D &getVelocity() const;
void setVelocity(const Vector2D &velocity);
const Vector2D &getPosition() const;
void setPosition(const Vector2D &position);
private:
static size_t IDCounter;
size_t id;
double mass;
Vector2D acceleration;
Vector2D velocity;
Vector2D position;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment