From 34c1651448eecc3c6b0f99f8fec27e600bfc0e4f Mon Sep 17 00:00:00 2001 From: Michael Barlow Date: Thu, 15 Mar 2018 11:26:32 -0600 Subject: [PATCH] doc directory added, incl. model and implementation notes, see https://github.com/phetsims/gravity-force-lab-basics/issues/55 --- doc/implementation-notes.md | 20 ++++++++++++++++++++ doc/model.md | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 doc/implementation-notes.md create mode 100644 doc/model.md diff --git a/doc/implementation-notes.md b/doc/implementation-notes.md new file mode 100644 index 0000000..4918e70 --- /dev/null +++ b/doc/implementation-notes.md @@ -0,0 +1,20 @@ +# Gravity Force Lab Basics - Implementation Notes + +This document contains notes that will be helpful to developers and future maintainers of this simulation. + +## Model + +Start by reading the model description in https://github.com/phetsims/gravity-force-lab-basics/blob/master/doc/model.md + +Following that, almost all types in the model and view are inherited from the Inverse Square Law Common library. It will be useful to become familiar with its [model](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/model.md) and [implementation](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/implementation-notes.md) + +The primary type in this sim is the `Mass`. It handles all positioning as well as the mass values needed to calculate the displayed force. It is an ISLCObject where only one of radius or density is dynamic at a time. + +Unlike in Coulomb's Law, here the force can only be attractive, and it is measured from the objects' centers. + +## View + +The user will mainly be interacting with the ruler, the mass objects, and their control panel. The mass objects have a minimum separation that is always maintained. When dragging one mass, the other's position will never change. Finally, the arrows are added to the screenviews as siblings of the mass nodes themselves. This ensures that both arrows appear in the top layer of the scene graph. + +### Mass Nodes +These are instances of ISLCObjectNodes with dynamic or constant radius. See the [ISLC implementation](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/implementation-notes.md) for the details on updating pullers, force values, and arrows. diff --git a/doc/model.md b/doc/model.md new file mode 100644 index 0000000..7c774ae --- /dev/null +++ b/doc/model.md @@ -0,0 +1,18 @@ +Model Notes +=========== + +This document describes the model for the Gravity Force Lab simulation.
+@author Jesse Greenberg (PhET Interactive Simulations) +@author Michael Barlow (PhET Interactive Simulations) + +The underlying model for gravitational forces between two masses depicted in this simulation is Newton's law of Gravitation. +Please see +https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation for more information on this. + +The simulation portrays how the gravitational force changes when masses are changed or the distance between them changes. + +## Inverse Square Law + +As an example of an Inverse Square Law, the underlying model for the gravitational force can be found at: + +[Inverse Square Law Common](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/model.md)