• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

step/stepcore

StepCore::GravitationForce

StepCore::GravitationForce Class Reference
[Physical forces]

Newton gravitational force. More...

#include <gravitation.h>

Inheritance diagram for StepCore::GravitationForce:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GravitationForce (double gravitationConst=Constants::Gravitational)
void calcForce (bool calcVariances)
double gravitationConst () const
GravitationForceErrors * gravitationForceErrors ()
void setGravitationConst (double gravitationConst)

Protected Member Functions

ObjectErrors * createObjectErrors ()

Protected Attributes

double _gravitationConst

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} \]

where:
$G$ is GravitationForce::gravitationConst
$m_1$ and $m_2$ is Particle::mass of first and second body
$\overrightarrow{r}$ 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

void StepCore::GravitationForce::calcForce ( bool  calcVariances  )  [virtual]

Calculate force.

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

Implements StepCore::Force.

Definition at line 65 of file gravitation.cc.

ObjectErrors* StepCore::GravitationForce::createObjectErrors (  )  [inline, protected, virtual]

For internal use only.

Creates specific ObjectErrors-derived class (to be reimplemented in derived classes)

Reimplemented from StepCore::Item.

Definition at line 100 of file gravitation.h.

double StepCore::GravitationForce::gravitationConst (  )  const [inline]

Get gravitational constant.

Definition at line 91 of file gravitation.h.

GravitationForceErrors* StepCore::GravitationForce::gravitationForceErrors (  )  [inline]

Get (and possibly create) GravitationForceErrors object.

Definition at line 96 of file gravitation.h.

void StepCore::GravitationForce::setGravitationConst ( double  gravitationConst  )  [inline]

Set gravitational constant.

Definition at line 93 of file gravitation.h.


Member Data Documentation

double StepCore::GravitationForce::_gravitationConst [protected]

Definition at line 102 of file gravitation.h.


The documentation for this class was generated from the following files:
  • gravitation.h
  • gravitation.cc

step/stepcore

Skip menu "step/stepcore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal