CoulombForce Class Reference
[Physical forces]

Coulomb electrostatic force. More...

#include <coulombforce.h>

Inheritance diagram for CoulombForce:

Item Force Object List of all members.

Public Member Functions

 CoulombForce (double electricConst=Constants::Electric)
void calcForce ()
double electricConst () const
void setElectricConst (double electricConst)
virtual void worldItemRemoved (Item *item)
virtual void setWorld (World *world)
Worldworld () const
const QString & name () const
void setName (const QString &name)

Detailed Description

Coulomb electrostatic force.

The force acts between pairs of charged bodies (currently only ChargedParticle) and equals:

\[ \overrightarrow{f} = \frac{1}{4\pi\epsilon_0} \frac{q_1 q_2 \overrightarrow{r}} {|\overrightarrow{r}|^3} \]

where:
$\epsilon_0$ is CoulombForce::electricConst
$q_1$ and $q_2$ is ChargedParticle::charge of the first and second body
$\overrightarrow{r}$ is difference of Particle::position of the first and second body

Todo:
Add interface for charged bodies, support bodies with distributed charge


Constructor & Destructor Documentation

CoulombForce ( double  electricConst = Constants::Electric  ) 

Constructs CoulombForce


Member Function Documentation

void calcForce (  )  [virtual]

Calculate force. Bodies can be accessed through this->world()->bodies()

Implements Force.

double electricConst (  )  const [inline]

Get electric const

void setElectricConst ( double  electricConst  )  [inline]

Set electric const

virtual void worldItemRemoved ( Item item  )  [inline, virtual, inherited]

Called by the World when any item is removed from the world

Parameters:
item Pointer to removed item
Todo:
XXX rename

Reimplemented in Spring.

virtual void setWorld ( World world  )  [inline, virtual, inherited]

Set/change pointer to World in which this object lives

Reimplemented in Spring.

World* world (  )  const [inline, inherited]

Get pointer to World in which this object lives

Returns:
Pointer to the World or NULL

const QString& name (  )  const [inline, inherited]

Returns name of the object

void setName ( const QString &  name  )  [inline, inherited]

Set name of the object


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 14:23:37 2007 for StepCore by  doxygen 1.5.1