Gravity Engine  1.5
Unity Asset for Gravity
NewtonForce Class Reference

Newton force. This is not generally used - since Netwonian gravity is the more efficient default force built in to the integrators. More...

Inheritance diagram for NewtonForce:
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...
 

Detailed Description

Newton force. This is not generally used - since Netwonian gravity is the more efficient default force built in to the integrators.

This code is used to double check the force delegate code

Member Function Documentation

double NewtonForce.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 NewtonForce.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: