step/stepcore
#include <gravitation.h>

| Protected Member Functions | |
| ObjectErrors * | createObjectErrors () | 
| Protected Attributes | |
| double | _gravitationConst | 
|  Protected Attributes inherited from StepCore::Object | |
| QString | _name | 
Detailed Description
Newton gravitational force.
The force acts between pairs of massive bodies (currently only Particle) and equals:
![\[ \overrightarrow{f} = G \frac{m_1 m_2 \overrightarrow{r}} {|\overrightarrow{r}|^3} \]](form_9.png) 
 where:
  is GravitationForce::gravitationConst
 is GravitationForce::gravitationConst
  and
 and  is Particle::mass of first and second body
 is Particle::mass of first and second body
  is difference of Particle::position of the first and second body
 is difference of Particle::position of the first and second body
- Todo:
- Add interface for massive bodies, support bodies with distributed mass
Definition at line 80 of file gravitation.h.
Constructor & Destructor Documentation
| StepCore::GravitationForce::GravitationForce | ( | double | gravitationConst = Constants::Gravitational | ) | 
Constructs GravitationForce.
Definition at line 58 of file gravitation.cc.
Member Function Documentation
| 
 | virtual | 
Calculate force.
Bodies can be accessed through this->world()->bodies()
Implements StepCore::Force.
Definition at line 65 of file gravitation.cc.
| 
 | inlineprotectedvirtual | 
Creates specific ObjectErrors-derived class (to be reimplemented in derived classes)
Reimplemented from StepCore::Item.
Definition at line 100 of file gravitation.h.
| 
 | inline | 
Get gravitational constant.
Definition at line 91 of file gravitation.h.
| 
 | inline | 
Get (and possibly create) GravitationForceErrors object.
Definition at line 96 of file gravitation.h.
| 
 | inline | 
Set gravitational constant.
Definition at line 93 of file gravitation.h.
Member Data Documentation
| 
 | protected | 
Definition at line 102 of file gravitation.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
 KDE API Reference
    KDE API Reference