From 30cc264b7381cd1895ea8a3b709567e6eaf1113d Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 13 Mar 2011 14:25:15 +0000 Subject: Creation d'un systeme de test automatise. --- src/main/Particle.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/main/Particle.h') diff --git a/src/main/Particle.h b/src/main/Particle.h index 128dbb1..cc15c93 100644 --- a/src/main/Particle.h +++ b/src/main/Particle.h @@ -16,10 +16,27 @@ class Particle { private: Vector3D position; + Vector3D force; + double mass; + double charge; public: -/* - Vector3D getPosition(); + + void applyForce(const Vector3D& f) {force = force + f;} + + Vector3D getPosition() const {return position;} + + void setPosition(const Vector3D& pos) {position = pos;} + + Vector3D getForce() const {return force;} + + double getMass() const {return mass;} + + double getCharge() const {return charge;} + + + /* + Vector3D getPosition() {return position;} Vector3D getVelocity(); @@ -29,7 +46,12 @@ public: Vector3D getMomentum(); */ - Particle(): position(0, 0, 0) {}; + Particle(const Vector3D& position0, double mass, double charge): + position(position0), + force(0, 0, 0), + mass(mass), + charge(charge) {}; + virtual ~Particle(); }; -- cgit v1.2.3