Renamed f -> a. f is actually representing acceleration.

This commit is contained in:
Dennis Hotson 2011-11-26 13:44:32 +11:00
parent b791fafe9a
commit e453d7728a

View File

@ -488,13 +488,10 @@ Layout.ForceDirected.Point = function(position, mass) {
this.p = position; // position
this.m = mass; // mass
this.v = new Vector(0, 0); // velocity
// Based on the usage, the "force" member looks more like an
// "acceleration".
this.a = new Vector(0, 0); // force
this.a = new Vector(0, 0); // acceleration
};
Layout.ForceDirected.Point.prototype.applyForce = function(force) {
// Ditto on acceleration, here: a = F/m
this.a = this.a.add(force.divide(this.m));
};