Class LinearFunction

java.lang.Object
velo.ladaalpha.fields.math.LinearFunction
Direct Known Subclasses:
Demand, Supply

public class LinearFunction extends Object
The Class LinearFunction.
  • 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 m
      b - 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 1
      y1 - the y 1
      x2 - the x 2
      y2 - the y 2
    • BuildFromTwoPoints

      public LinearFunction BuildFromTwoPoints(double x1, double y1, double x2, double y2)
      Builds the from two points.
      Parameters:
      x1 - the x 1
      y1 - the y 1
      x2 - the x 2
      y2 - the y 2
      Returns:
      the linear function
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the 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