Gravity Engine  1.5
Unity Asset for Gravity
ForceR2 Class Reference
Inheritance diagram for ForceR2:
IForceDelegate

Public Member Functions

double CalcF (double r_sep)
 Calculate the distance dependent force of two bodies seperated by distance r_sep. (Note: This has taken e.g. F1 = m1 a1 = (G m1 m2)/r^2 and removes m1 and m2. These are handled in the integrator. More...
 
double CalcFdot (double r_sep)
 Calculates the time derivitive of the force law This function is required only by the Hermite algorithm. If Leapfrog is used it can be stubbed out. More...
 

Member Function Documentation

double ForceR2.CalcF ( double  r_sep)

Calculate the distance dependent force of two bodies seperated by distance r_sep. (Note: This has taken e.g. F1 = m1 a1 = (G m1 m2)/r^2 and removes m1 and m2. These are handled in the integrator.

e.g. for Newtonian (1/R^2) gravity this would be: m2/(r_sep*r_sep);

Returns
The accel.
Parameters
m2M2.
r_sepR sep. The distance between the bodies

Implements IForceDelegate.

double ForceR2.CalcFdot ( double  r_sep)

Calculates the time derivitive of the force law This function is required only by the Hermite algorithm. If Leapfrog is used it can be stubbed out.

e.g. for Newtonian (1/R^2) gravity

Returns
The jerk.
Parameters
m2M2.
r_sepR sep.

Implements IForceDelegate.


The documentation for this class was generated from the following file: