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

step/stepcore

  • StepCore
  • GravitationForce
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StepCore::GravitationForce Class Reference
Physical forces

#include <gravitation.h>

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

Public Member Functions

 GravitationForce (double gravitationConst=Constants::Gravitational)
 
void calcForce (bool calcVariances)
 
double gravitationConst () const
 
GravitationForceErrors * gravitationForceErrors ()
 
void setGravitationConst (double gravitationConst)
 
- Public Member Functions inherited from StepCore::Item
 Item (const QString &name=QString())
 
 Item (const Item &item)
 
virtual ~Item ()
 
Color color () const
 
void deleteObjectErrors ()
 
ItemGroup * group () const
 
ObjectErrors * objectErrors ()
 
Item & operator= (const Item &item)
 
void setColor (Color color)
 
virtual void setGroup (ItemGroup *group)
 
virtual void setWorld (World *world)
 
ObjectErrors * tryGetObjectErrors () const
 
World * world () const
 
virtual void worldItemRemoved (Item *item STEPCORE_UNUSED)
 
- Public Member Functions inherited from StepCore::Object
 Object (const QString &name=QString())
 
virtual ~Object ()
 
const QString & name () const
 
void setName (const QString &name)
 
- Public Member Functions inherited from StepCore::Force
virtual ~Force ()
 

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

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 ( )
inlineprotectedvirtual

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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

step/stepcore

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal