Created
June 21, 2016 17:12
-
-
Save shastikk/f3e2692b4ea6471db9bac35fda7c4fc2 to your computer and use it in GitHub Desktop.
Method for very basic bundling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void applyElectrostaticForces (double totalValue, Edge a, Edge b, int i, double x, double y, double multiplier) | |
| { | |
| double difference = Math.min(subpoints.size()-i, i+1); | |
| double divisor = 1 / (Math.pow(difference,1.15) + 1); | |
| double moveX = x * difference * multiplier * divisor; | |
| a.subpoints.get(i).xCoord -= moveX; | |
| b.subpoints.get(i).xCoord += moveX; | |
| double moveY = y * difference * multiplier * divisor; | |
| a.subpoints.get(i).yCoord -= moveY; | |
| b.subpoints.get(i).yCoord += moveY; | |
| System.out.println("The coordinates are {" + a.subpoints.get(i).xCoord + "," + a.subpoints.get(i).yCoord + ""); | |
| System.out.println("The coordinates are {" + b.subpoints.get(i).xCoord + "," + b.subpoints.get(i).yCoord + ""); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment