blob: cc15c93798662b50d5d55923c45c01281f954b3e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*
* Particle.h
*
* Created on: Mar 9, 2011
* Author: jakob
*/
#ifndef PARTICLE_H_
#define PARTICLE_H_
#include "Vector3D.h"
namespace vhc {
class Particle {
private:
Vector3D position;
Vector3D force;
double mass;
double charge;
public:
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();
Vector3D getEnergy();
Vector3D getGamma();
Vector3D getMomentum();
*/
Particle(const Vector3D& position0, double mass, double charge):
position(position0),
force(0, 0, 0),
mass(mass),
charge(charge) {};
virtual ~Particle();
};
}
#endif /* PARTICLE_H_ */
|