public class LinLog extends Force
Constructor and Description |
---|
LinLog()
Parameter-less constructor.
|
Modifier and Type | Method and Description |
---|---|
float[] |
computeAttractiveForce(float deltaX,
float deltaY,
float distance,
float squareDistance,
int v1Deg,
int v2Deg)
This method computes the attractive force between two vertices.
|
float[] |
computeRepulsiveForce(float deltaX,
float deltaY,
float distance,
float squareDistance,
int v1Deg,
int v2Deg)
This method computes the repulsive force module between two vertices.
|
void |
generateForce(java.lang.String[] args,
float k)
This method builds the force instance with the given arguments and the optimal spring length.
|
public LinLog()
public float[] computeAttractiveForce(float deltaX, float deltaY, float distance, float squareDistance, int v1Deg, int v2Deg)
Force
computeAttractiveForce
in class Force
deltaX
- The vertices distance on the X axis.deltaY
- The vertices distance on the Y axis.distance
- The distance module.squareDistance
- The distance square module.v1Deg
- The degree of the first vertex.v2Deg
- The degree of the second vertex.public float[] computeRepulsiveForce(float deltaX, float deltaY, float distance, float squareDistance, int v1Deg, int v2Deg)
Force
computeRepulsiveForce
in class Force
deltaX
- The vertices distance on the X axis.deltaY
- The vertices distance on the Y axis.distance
- The distance module.squareDistance
- The distance square module.v1Deg
- The degree of the first vertex.v2Deg
- The degree of the second vertex.public void generateForce(java.lang.String[] args, float k)
Force
generateForce
in class Force
args
- The arguments.k
- The optimal spring length.