summaryrefslogtreecommitdiff
path: root/src/main/Particle.h
diff options
context:
space:
mode:
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();
};