summaryrefslogtreecommitdiff
path: root/src/main/Particle.h
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2011-03-13 14:25:15 +0000
committerJakob Odersky <jodersky@gmail.com>2011-03-13 14:25:15 +0000
commit30cc264b7381cd1895ea8a3b709567e6eaf1113d (patch)
tree3683e4fe3647dbb5332b0d2988c0f3b07085194f /src/main/Particle.h
parentf2163b32810d75bb4ea3e3f7c91ccdf2c6ada61a (diff)
downloadvhc-30cc264b7381cd1895ea8a3b709567e6eaf1113d.tar.gz
vhc-30cc264b7381cd1895ea8a3b709567e6eaf1113d.tar.bz2
vhc-30cc264b7381cd1895ea8a3b709567e6eaf1113d.zip
Creation d'un systeme de test automatise.
Diffstat (limited to 'src/main/Particle.h')
-rw-r--r--src/main/Particle.h28
1 files changed, 25 insertions, 3 deletions
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();
};