GitHubDashboard/FDG/Diagram.cs
/// <summary>
/// Calculates the repulsion force between any two nodes in the diagram space.
/// </summary>
/// <param name="x">The node that the force is acting on.</param>
/// <param name="y">The node creating the force.</param>
/// <returns>A Vector representing the repulsion force.</returns>
Calculates the repulsion force between any two nodes in the diagram space.
Calculates the repulsion force between any two nodes in the diagram space .
private Vector CalcRepulsionForce(Node x, Node y)
		{
			double proximity = Math.Max(CalcDistance(x.Location, y.Location), 1);
			double force = -(REPULSION_CONSTANT / Math.Pow(proximity, 2));
			double angle = GetBearingAngle(x.Location, y.Location);
			return new Vector(force, angle);
		}
private Vector CalcRepulsionForce ( Node x , Node y ) { double proximity = Math . Max ( CalcDistance ( x . Location , y . Location ) , 1 ) ; double force = - ( REPULSION_CONSTANT / Math . Pow ( proximity , 2 ) ) ; double angle = GetBearingAngle ( x . Location , y . Location ) ; return new Vector ( force , angle ) ; }
Calculates the repulsion force between any two nodes in the diagram space.
Calculates the repulsion force between any two nodes in the diagram space .
// Coulomb's Law: F = k(Qq/r^2)
A Vector representing the repulsion force.
A Vector representing the repulsion force .
x
Node
The node that the force is acting on.
The node that the force is acting on .
y
Node
The node creating the force.
The node creating the force .