171172173174175176177178179180181
{ for( DNVNode v : nodes ) { Vector2D newPos = new Vector2D( v.getPosition() ); newPos.subtract( center ); newPos.normalize(); newPos.dotProduct( radius ); newPos.add( center ); v.setPosition( newPos ); } }
657658659660661662663664665666667
springForce.setX( (float)Math.random() ); springForce.setY( (float)Math.random() ); } else { springForce.normalize(); float delta; float intensity; delta = distance;// - restingDistance; intensity = k * delta; springForce.dotProduct( intensity );