Package velo.ladaalpha.fields.math
Class LinearFunction
java.lang.Object
velo.ladaalpha.fields.math.LinearFunction
The Class LinearFunction.
- 
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new linear function.LinearFunction(double m, double b) Instantiates a new linear function. - 
Method Summary
Modifier and TypeMethodDescriptionvoidbuildFromTwoPoints(double x1, double y1, double x2, double y2) Builds the from two points.BuildFromTwoPoints(double x1, double y1, double x2, double y2) Builds the from two points.doublecompute(double x) Compute.doublegetB()Gets the b.doublegetM()Gets the m.voidsetB(double b) Sets the b.voidsetM(double m) Sets the m.toString()To string. 
- 
Constructor Details
- 
LinearFunction
public LinearFunction()Instantiates a new linear function. - 
LinearFunction
public LinearFunction(double m, double b) Instantiates a new linear function.- Parameters:
 m- the mb- the b
 
 - 
 - 
Method Details
- 
buildFromTwoPoints
public void buildFromTwoPoints(double x1, double y1, double x2, double y2) Builds the from two points.- Parameters:
 x1- the x 1y1- the y 1x2- the x 2y2- the y 2
 - 
BuildFromTwoPoints
Builds the from two points.- Parameters:
 x1- the x 1y1- the y 1x2- the x 2y2- the y 2- Returns:
 - the linear function
 
 - 
toString
To string. - 
compute
public double compute(double x) Compute.- Parameters:
 x- the x- Returns:
 - the double
 
 - 
getM
public double getM()Gets the m.- Returns:
 - the m
 
 - 
setM
public void setM(double m) Sets the m.- Parameters:
 m- the m to set
 - 
getB
public double getB()Gets the b.- Returns:
 - the b
 
 - 
setB
public void setB(double b) Sets the b.- Parameters:
 b- the b to set
 
 -