Package  flare.physics 
Class  public class NBodyForce 
Implements  IForce 
F = G m1 m2 / d^2
,
where G is a constant (e.g., gravitational constant), m1 and m2 are the
masses (charge) of the particles, and d is the distance between them.
The algorithm used is that of J. Barnes and P. Hut, in their research paper A Hierarchical O(n log n) force calculation algorithm, Nature, v.324, December 1986. For more details on the algorithm, see one of the following links:
Property  Defined by  

gravitation : Number The gravitational constant to use.
 NBodyForce  
maxDistance : Number The maximum distance over which forces are exerted.
 NBodyForce  
minDistance : Number The minumum effective distance over which forces are exerted.
 NBodyForce 
Method  Defined by  

NBodyForce(g:Number = 1, max:Number = 200, min:Number = 2, eps:Number = 0.01, t:Number = 0.9)
Creates a new NBodyForce with given parameters.
 NBodyForce  
apply(sim:Simulation):void
Applies this force to a simulation.
 NBodyForce 
gravitation  property 
gravitation:Number
[readwrite]The gravitational constant to use. Negative values produce a repulsive force.
Implementation public function get gravitation():Number
public function set gravitation(value:Number):void
maxDistance  property 
maxDistance:Number
[readwrite]The maximum distance over which forces are exerted. Any greater distances will be ignored.
Implementation public function get maxDistance():Number
public function set maxDistance(value:Number):void
minDistance  property 
minDistance:Number
[readwrite]The minumum effective distance over which forces are exerted. Any lesser distances will be treated as the minimum.
Implementation public function get minDistance():Number
public function set minDistance(value:Number):void
NBodyForce  ()  constructor 
public function NBodyForce(g:Number = 1, max:Number = 200, min:Number = 2, eps:Number = 0.01, t:Number = 0.9)
Creates a new NBodyForce with given parameters.
Parametersg:Number (default = 1 ) — the gravitational constant to use.
Negative values produce a repulsive force.


max:Number (default = 200 ) — a maximum distance over which the force should operate.
Particles separated by more than this distance will not interact.


min:Number (default = 2 ) — the minimum distance over which the force should operate.
Particles closer than this distance will interact as if they were
the minimum distance apart. This helps avoid extreme forces.
Helpful when particles are very close together.


eps:Number (default = 0.01 ) — an epsilon values for determining a minimum distance
between particles


t:Number (default = 0.9 ) — the theta parameter for the BarnesHut approximation.
Determines the level of approximation (default value if 0.9).

apply  ()  method 
public function apply(sim:Simulation):void
Applies this force to a simulation.
Parameterssim:Simulation — the Simulation to apply the force to
