Package org.rascalmpl.library.vis.util.vector

Examples of org.rascalmpl.library.vis.util.vector.Vector2D.sub()


  public Vector2D repulsiveForceWall(Vector2D wallVector) {
    Vector2D thisVector = new Vector2D(getCenter());
    double distance2 = thisVector.distance2(wallVector);

    if (distance2 > 0) {
      return thisVector.sub(wallVector).mul(G.EDGE_LENGTH_2).div(distance2).mul(10 * G.REPEL);
    }
    return (new Vector2D(0, 0));
  }

  private final static double Deg45 = Math.toDegrees(Math.PI/4);
View Full Code Here


      }
    }

    // Attractive forces
    for (SpringGraphNode otherNode : in) {
      resultForce = resultForce.sub(this.attractiveForce(otherNode));
    }

    for (SpringGraphNode otherNode : out) {
      resultForce = resultForce.sub(attractiveForce(otherNode));
    }
View Full Code Here

    for (SpringGraphNode otherNode : in) {
      resultForce = resultForce.sub(this.attractiveForce(otherNode));
    }

    for (SpringGraphNode otherNode : out) {
      resultForce = resultForce.sub(attractiveForce(otherNode));
    }
   
    // Repulsion of left and right wall
   
    resultForce = resultForce.add(repulsiveForceWall(new Vector2D(0, y)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.