public class FR extends Force
| Constructor and Description |
|---|
FR()
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 float[] computeAttractiveForce(float deltaX,
float deltaY,
float distance,
float squareDistance,
int v1Deg,
int v2Deg)
ForcecomputeAttractiveForce in class ForcedeltaX - 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)
ForcecomputeRepulsiveForce in class ForcedeltaX - 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)
ForcegenerateForce in class Forceargs - The arguments.k - The optimal spring length.